feat(auth): plumb totp passcode through openIdAuth action

Allows the OpenIdAuth view to resubmit the OIDC callback with a
TOTP passcode after a 412/1017 response from the backend.

Refs GHSA-8jvc-mcx6-r4cg
This commit is contained in:
kolaente 2026-04-09 13:44:21 +02:00 committed by kolaente
parent d58dd7a7c6
commit 546db0dc21
1 changed files with 5 additions and 2 deletions

View File

@ -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<string, string> = {
code: code,
redirect_url: getRedirectUrlFromCurrentFrontendPath(fullProvider),
}
if (totpPasscode) {
data.totp_passcode = totpPasscode
}
// Delete an eventually preexisting old token
removeToken()