Add base logic to configure two factor on account
This commit is contained in:
parent
edf27a5542
commit
eb39826f46
15 changed files with 389 additions and 54 deletions
9
resources/scripts/api/account/enableAccountTwoFactor.ts
Normal file
9
resources/scripts/api/account/enableAccountTwoFactor.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
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);
|
||||
});
|
||||
};
|
9
resources/scripts/api/account/getTwoFactorTokenUrl.ts
Normal file
9
resources/scripts/api/account/getTwoFactorTokenUrl.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import http from '@/api/http';
|
||||
|
||||
export default (): Promise<string> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get('/api/client/account/two-factor')
|
||||
.then(({ data }) => resolve(data.data.image_url_data))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
Reference in a new issue