mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-20 23:33:45 +02:00
Finish authentication flow for 2FA
This commit is contained in:
18
resources/scripts/api/auth/loginCheckpoint.ts
Normal file
18
resources/scripts/api/auth/loginCheckpoint.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import http from '@/api/http';
|
||||
import { LoginResponse } from '@/api/auth/login';
|
||||
|
||||
export default (token: string, code: string): Promise<LoginResponse> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.post('/auth/login/checkpoint', {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
confirmation_token: token,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
authentication_code: code,
|
||||
})
|
||||
.then(response => resolve({
|
||||
complete: response.data.data.complete,
|
||||
intended: response.data.data.intended || undefined,
|
||||
}))
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user