diff --git a/frontend/src/stores/auth.ts b/frontend/src/stores/auth.ts index 8e8d5760e..e2576760f 100644 --- a/frontend/src/stores/auth.ts +++ b/frontend/src/stores/auth.ts @@ -238,17 +238,20 @@ export const useAuthStore = defineStore('auth', () => { } } - async function openIdAuth({provider, code}) { + async function openIdAuth({provider, code, totpPasscode}: {provider: string, code: string, totpPasscode?: string}) { const HTTP = HTTPFactory() setIsLoading(true) setLoggedInVia(null) const fullProvider: IProvider = configStore.auth.openidConnect.providers.find((p: IProvider) => p.key === provider) - const data = { + const data: Record = { code: code, redirect_url: getRedirectUrlFromCurrentFrontendPath(fullProvider), } + if (totpPasscode) { + data.totp_passcode = totpPasscode + } // Delete an eventually preexisting old token removeToken()