Add note about Oauth

This commit is contained in:
Brian Lee 2025-10-17 10:18:35 -07:00
parent 76a1f93957
commit b66ecd75bd
2 changed files with 34 additions and 29 deletions

View File

@ -150,6 +150,9 @@
Use the OAuth Login above; we request <code>scp:offline_access</code> to allow refresh without reprompting. Use the OAuth Login above; we request <code>scp:offline_access</code> to allow refresh without reprompting.
</li> </li>
</ol> </ol>
<p>
<strong>Multienvironment setup:</strong> If you deploy to multiple environments (dev, staging, production), you must register <strong>all redirect URIs</strong> in your BeatLeader OAuth application. For example: <code>http://localhost:5173/auth/beatleader/callback</code>, <code>https://staging.example.com/auth/beatleader/callback</code>, and <code>https://example.com/auth/beatleader/callback</code>. The app automatically uses the correct redirect URI based on the current environment's origin.
</p>
<h2 id="usage">How this app uses your auth</h2> <h2 id="usage">How this app uses your auth</h2>
<ul> <ul>

View File

@ -523,35 +523,37 @@
{/key} {/key}
</div> </div>
{/if} {/if}
<div class="mt-3"> <div class="mt-3 flex items-center gap-2">
<SongPlayer hash={item.hash} preferBeatLeader={true} /> <div class="w-1/2 flex flex-wrap gap-2">
</div> <a
<div class="mt-3 flex flex-wrap gap-2"> class="rounded-md border border-white/10 px-2 py-1 text-xs hover:border-white/20"
<a href={item.leaderboardId
class="rounded-md border border-white/10 px-2 py-1 text-xs hover:border-white/20" ? `https://beatleader.com/leaderboard/global/${item.leaderboardId}`
href={item.leaderboardId : `https://beatleader.com/leaderboard/global/${item.hash}?diff=${encodeURIComponent(item.difficulties[0]?.name ?? 'ExpertPlus')}&mode=${encodeURIComponent(item.difficulties[0]?.characteristic ?? 'Standard')}`}
? `https://beatleader.com/leaderboard/global/${item.leaderboardId}` target="_blank"
: `https://beatleader.com/leaderboard/global/${item.hash}?diff=${encodeURIComponent(item.difficulties[0]?.name ?? 'ExpertPlus')}&mode=${encodeURIComponent(item.difficulties[0]?.characteristic ?? 'Standard')}`} rel="noopener"
target="_blank" title="Open in BeatLeader"
rel="noopener" >BL</a
title="Open in BeatLeader" >
>BL</a <a
> class="rounded-md border border-white/10 px-2 py-1 text-xs hover:border-white/20"
<a href={metaByHash[item.hash]?.key ? `https://beatsaver.com/maps/${metaByHash[item.hash]?.key}` : `https://beatsaver.com/search/hash/${item.hash}`}
class="rounded-md border border-white/10 px-2 py-1 text-xs hover:border-white/20" target="_blank"
href={metaByHash[item.hash]?.key ? `https://beatsaver.com/maps/${metaByHash[item.hash]?.key}` : `https://beatsaver.com/search/hash/${item.hash}`} rel="noopener"
target="_blank" title="Open in BeatSaver"
rel="noopener" >BSR</a
title="Open in BeatSaver" >
>BSR</a <button
> class="rounded-md border border-white/10 px-2 py-1 text-xs hover:border-white/20 disabled:opacity-50"
<button class:lit-up={litButtons.has(`bsr-${item.hash}`)}
class="rounded-md border border-white/10 px-2 py-1 text-xs hover:border-white/20 disabled:opacity-50" on:click={() => { const key = metaByHash[item.hash]?.key; if (key) copyBsrCommand(key, item.hash); }}
class:lit-up={litButtons.has(`bsr-${item.hash}`)} disabled={!metaByHash[item.hash]?.key}
on:click={() => { const key = metaByHash[item.hash]?.key; if (key) copyBsrCommand(key, item.hash); }} title="Copy !bsr"
disabled={!metaByHash[item.hash]?.key} >Copy !bsr</button>
title="Copy !bsr" </div>
>Copy !bsr</button> <div class="w-1/2">
<SongPlayer hash={item.hash} preferBeatLeader={true} />
</div>
</div> </div>
</div> </div>
</article> </article>