diff --git a/packages/core/src/api/apis/implementations/lib/AuthConnector/DefaultAuthConnector.ts b/packages/core/src/api/apis/implementations/lib/AuthConnector/DefaultAuthConnector.ts index 498565e10e..12a2118a42 100644 --- a/packages/core/src/api/apis/implementations/lib/AuthConnector/DefaultAuthConnector.ts +++ b/packages/core/src/api/apis/implementations/lib/AuthConnector/DefaultAuthConnector.ts @@ -94,6 +94,10 @@ export class DefaultAuthConnector this.sessionTransform = sessionTransform; } + async createSession(scopes: Set): Promise { + return this.authRequester(scopes); + } + async refreshSession(): Promise { const res = await fetch(this.buildUrl('/token', { optional: true }), { headers: { @@ -138,10 +142,6 @@ export class DefaultAuthConnector } } - async createSession(scopes: Set): Promise { - return this.authRequester(scopes); - } - private async showPopup(scope: string): Promise { const popupUrl = this.buildUrl('/start', { scope }); diff --git a/packages/core/src/api/apis/implementations/lib/AuthConnector/MockAuthConnector.ts b/packages/core/src/api/apis/implementations/lib/AuthConnector/MockAuthConnector.ts index 50f045671a..9134fd0773 100644 --- a/packages/core/src/api/apis/implementations/lib/AuthConnector/MockAuthConnector.ts +++ b/packages/core/src/api/apis/implementations/lib/AuthConnector/MockAuthConnector.ts @@ -33,13 +33,13 @@ const defaultMockSession: MockSession = { export class MockAuthConnector implements AuthConnector { constructor(private readonly mockSession: MockSession = defaultMockSession) {} + async createSession() { + return this.mockSession; + } + async refreshSession() { return this.mockSession; } async removeSession() {} - - async createSession() { - return this.mockSession; - } } diff --git a/packages/core/src/api/apis/implementations/lib/AuthConnector/types.ts b/packages/core/src/api/apis/implementations/lib/AuthConnector/types.ts index 86858a90e5..ad3188dee4 100644 --- a/packages/core/src/api/apis/implementations/lib/AuthConnector/types.ts +++ b/packages/core/src/api/apis/implementations/lib/AuthConnector/types.ts @@ -24,7 +24,7 @@ export type BaseAuthSession = { * by for example communicating with a backend or interacting with the user. */ export type AuthConnector = { + createSession(scopes: Set): Promise; refreshSession(): Promise; removeSession(): Promise; - createSession(scopes: Set): Promise; };