[UI] Display the 2FA token, show spinner on load (#3367)
Co-authored-by: Dane Everitt <dane@daneeveritt.com>
This commit is contained in:
parent
924f00ac9a
commit
bda1ff50ab
5 changed files with 49 additions and 27 deletions
15
resources/scripts/api/account/getTwoFactorTokenData.ts
Normal file
15
resources/scripts/api/account/getTwoFactorTokenData.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import http from '@/api/http';
|
||||
|
||||
export interface TwoFactorTokenData {
|
||||
// eslint-disable-next-line camelcase
|
||||
image_url_data: string;
|
||||
secret: string;
|
||||
}
|
||||
|
||||
export default (): Promise<TwoFactorTokenData> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.get('/api/client/account/two-factor')
|
||||
.then(({ data }) => resolve(data.data))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue