1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  | 
import { CompleteTOTPSignInPath, TOTPRegistrationPath } from "@services/Api";
import {
    DeleteWithOptionalResponse,
    PostWithOptionalResponse,
    PostWithOptionalResponseRateLimited,
} from "@services/Client";
import { SignInResponse } from "@services/SignIn";
interface CompleteTOTPSignInBody {
    token: string;
    targetURL?: string;
    workflow?: string;
    workflowID?: string;
}
export function completeTOTPSignIn(passcode: string, targetURL?: string, workflow?: string, workflowID?: string) {
    const body: CompleteTOTPSignInBody = {
        token: `${passcode}`,
        targetURL: targetURL,
        workflow: workflow,
        workflowID: workflowID,
    };
    return PostWithOptionalResponseRateLimited<SignInResponse>(CompleteTOTPSignInPath, body);
}
export function completeTOTPRegister(passcode: string) {
    const body: CompleteTOTPSignInBody = {
        token: `${passcode}`,
    };
    return PostWithOptionalResponse(TOTPRegistrationPath, body);
}
export function stopTOTPRegister() {
    return DeleteWithOptionalResponse(TOTPRegistrationPath);
}
  |