feat: add MFA recovery codes

This commit is contained in:
Paul Makles
2022-06-12 16:30:37 +01:00
parent 8eefc87b05
commit c686e85d37
7 changed files with 247 additions and 45 deletions

View File

@@ -17,19 +17,15 @@ export default function AccountManagement() {
const client = useClient();
const callback = (route: "disable" | "delete") => () =>
modalController.push({
type: "mfa_flow",
state: "known",
client,
callback: ({ token }) =>
client.api
.post(`/auth/account/${route}`, undefined, {
headers: {
"X-MFA-Ticket": token,
},
})
.then(() => logOut(true)),
});
modalController.mfaFlow(client).then(({ token }) =>
client.api
.post(`/auth/account/${route}`, undefined, {
headers: {
"X-MFA-Ticket": token,
},
})
.then(() => logOut(true)),
);
return (
<>