Skip to content

Commit

Permalink
Fix not refreshing session on failed OAuth
Browse files Browse the repository at this point in the history
  • Loading branch information
luminamystere committed Mar 13, 2024
1 parent afd4bb4 commit 6047a6b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Fluff4me.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ export default class Fluff4me {

async function openOAuthPopup (serviceName: string) {
const redirect = encodeURIComponent(`${Env.API_ORIGIN}auth/${serviceName}/callback`);
const success = await popup(OAUTH_SERVICE_REGISTRY[serviceName](redirect), 600, 900)
await popup(OAUTH_SERVICE_REGISTRY[serviceName](redirect), 600, 900)
.then(() => true).catch(err => { console.warn(err); return false; });

if (success)
await Session.refresh();
await Session.refresh();
}

for (const service of Object.keys(OAUTH_SERVICE_REGISTRY))
Expand Down

0 comments on commit 6047a6b

Please sign in to comment.