Skip to content

Commit 873efab

Browse files
Ensures new session is fetched on forceNewSession case
1 parent baba59f commit 873efab

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/plus/integrations/authentication/integrationAuthentication.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,13 @@ abstract class IntegrationAuthenticationProviderBase<ID extends IntegrationId =
147147
): Promise<ProviderAuthenticationSession | undefined> {
148148
const sessionId = this.getSessionId(descriptor);
149149

150-
const storedSession = await this.restoreSession(sessionId);
151-
152-
let session = storedSession;
150+
let session;
151+
let storedSession;
153152
if (options?.forceNewSession) {
154-
session = undefined;
155153
await this.deleteAllSecrets(sessionId);
154+
} else {
155+
storedSession = await this.restoreSession(sessionId);
156+
session = storedSession;
156157
}
157158

158159
const isExpiredSession = session?.expiresAt != null && new Date(session.expiresAt).getTime() < Date.now();

0 commit comments

Comments
 (0)