Display generated recovery tokens when enabling two factor

This commit is contained in:
Dane Everitt 2020-07-02 22:23:25 -07:00
parent c522935403
commit 795e045950
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 82 additions and 49 deletions

View file

@ -1,9 +1,7 @@
import http from '@/api/http';
export default (code: string): Promise<void> => {
return new Promise((resolve, reject) => {
http.post('/api/client/account/two-factor', { code })
.then(() => resolve())
.catch(reject);
});
export default async (code: string): Promise<string[]> => {
const { data } = await http.post('/api/client/account/two-factor', { code });
return data.attributes.tokens;
};