mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-14 12:23:44 +02:00
Add base logic to configure two factor on account
This commit is contained in:
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 New Issue
Block a user