A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: use localstorage for oauth redirects

+46 -11
+1 -1
src/components/input/dropbox/element.js
··· 55 55 // 🛠️ 56 56 57 57 authorize() { 58 - sessionStorage.setItem("oauth/callback/redirect_path", location.pathname + location.search); 58 + localStorage.setItem("oauth/callback/redirect_path", location.pathname + location.search); 59 59 60 60 const params = new URLSearchParams({ 61 61 response_type: "token",
+7
src/components/output/raw/atproto/element.js
··· 204 204 } 205 205 206 206 /** 207 + * @returns {Promise<void>} 208 + */ 209 + whenRestored() { 210 + return this.#restoreSettled.promise; 211 + } 212 + 213 + /** 207 214 * Sign out and revoke the current session. 208 215 */ 209 216 async logout() {
+4 -4
src/components/output/raw/atproto/oauth.js
··· 83 83 export async function login(handle) { 84 84 configureOAuth(OAUTH_CONFIG); 85 85 86 - sessionStorage.setItem( 86 + localStorage.setItem( 87 87 "oauth/callback/redirect_path", 88 88 location.pathname + location.search, 89 89 ); 90 90 91 - sessionStorage.setItem("oauth/pending-client", CLIENT_KEY); 91 + localStorage.setItem("oauth/pending-client", CLIENT_KEY); 92 92 93 93 const authUrl = await createAuthorizationUrl({ 94 94 target: { type: "account", identifier: /** @type {any} */ (handle) }, ··· 118 118 119 119 if ( 120 120 params.has("code") && 121 - sessionStorage.getItem("oauth/pending-client") === CLIENT_KEY 121 + localStorage.getItem("oauth/pending-client") === CLIENT_KEY 122 122 ) { 123 - sessionStorage.removeItem("oauth/pending-client"); 123 + localStorage.removeItem("oauth/pending-client"); 124 124 125 125 const result = await finalizeAuthorization(params); 126 126
+1
src/components/output/raw/atproto/types.d.ts
··· 11 11 getLatestCommit(): Promise<string | null>; 12 12 login(handle: string): Promise<void>; 13 13 logout(): Promise<void>; 14 + whenRestored(): Promise<void>; 14 15 };
+4 -4
src/components/supplement/rocksky/oauth.js
··· 78 78 export async function login(handle) { 79 79 configureOAuth(OAUTH_CONFIG); 80 80 81 - sessionStorage.setItem( 81 + localStorage.setItem( 82 82 "oauth/callback/redirect_path", 83 83 location.pathname + location.search, 84 84 ); 85 85 86 - sessionStorage.setItem("oauth/pending-client", CLIENT_KEY); 86 + localStorage.setItem("oauth/pending-client", CLIENT_KEY); 87 87 88 88 const authUrl = await createAuthorizationUrl({ 89 89 target: { type: "account", identifier: /** @type {any} */ (handle) }, ··· 109 109 110 110 if ( 111 111 params.has("code") && 112 - sessionStorage.getItem("oauth/pending-client") === CLIENT_KEY 112 + localStorage.getItem("oauth/pending-client") === CLIENT_KEY 113 113 ) { 114 - sessionStorage.removeItem("oauth/pending-client"); 114 + localStorage.removeItem("oauth/pending-client"); 115 115 116 116 const result = await finalizeAuthorization(params); 117 117
+21
src/facets/connect/atproto/index.inline.js
··· 44 44 const $passkeyWorking = signal(false); 45 45 46 46 //////////////////////////////////////////// 47 + // OAUTH CALLBACK LOADING STATE 48 + //////////////////////////////////////////// 49 + 50 + if (true) { 51 + litRender( 52 + html` 53 + <div class="facet__left"></div> 54 + <div class="facet__right"> 55 + <p class="with-icon"> 56 + <i class="ph-bold ph-spinner animate-spin"></i> 57 + Connecting to the Atmosphere 58 + </p> 59 + </div> 60 + `, 61 + /** @type {HTMLElement} */ (document.querySelector("main")), 62 + ); 63 + 64 + await atprotoEl.whenRestored(); 65 + } 66 + 67 + //////////////////////////////////////////// 47 68 // UI 48 69 //////////////////////////////////////////// 49 70
+2 -2
src/oauth/callback/index.js
··· 1 1 const prefix = "oauth/callback"; 2 - const redirect_path = sessionStorage.getItem(`${prefix}/redirect_path`) ?? "/"; 2 + const redirect_path = localStorage.getItem(`${prefix}/redirect_path`) ?? "/"; 3 3 4 - sessionStorage.removeItem(`${prefix}/redirect_path`); 4 + localStorage.removeItem(`${prefix}/redirect_path`); 5 5 location.assign(`${redirect_path}${location.hash}`);
+6
src/styles/diffuse/facet.css
··· 369 369 opacity: 0.55; 370 370 } 371 371 } 372 + 373 + .with-icon { 374 + align-items: center; 375 + display: inline-flex; 376 + gap: var(--space-3xs); 377 + }