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:
parent
d58dd7a7c6
commit
546db0dc21
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue