-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.ts
61 lines (53 loc) · 1.5 KB
/
types.ts
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
type BaseLaunchOptions = {
/**
* How the Authsignal Prebuilt MFA page should launch.
* `popup` will cause it to open in a overlay, whilst `redirect`
* will trigger a full page redirect.
* If no value is supplied, mode defaults to `redirect`.
*/
mode?: "popup" | "redirect";
};
type RedirectLaunchOptions = BaseLaunchOptions & {
mode: "redirect";
};
type PopupLaunchOptions = BaseLaunchOptions & {
mode: "popup";
popupOptions?: {
/** Any valid CSS value for the `width` property. */
width?: string;
/**
* @deprecated The popup will automatically resize to fit the content.
*/
height?: string;
};
};
export type LaunchOptions = RedirectLaunchOptions | PopupLaunchOptions;
export type AuthsignalOptions = {
publishableKey: string;
/**
* Cookie domain that will be used to identify
* users. If not set, location.hostname will be used
*/
cookieDomain?: string;
/**
* Tracking host (where API calls will be sent). If not set,
* we'd try to do the best to "guess" it. Last resort is t.authsignal.com.
*
* Though this parameter is not required, it's highly recommended to set is explicitly
*/
trackingHost?: string;
/**
* Name of id cookie. `__as_aid` by default
*/
cookieName?: string;
};
export enum AuthsignalWindowMessage {
AUTHSIGNAL_CLOSE_POPUP = "AUTHSIGNAL_CLOSE_POPUP",
}
export type AuthsignalWindowMessageData = {
event: AuthsignalWindowMessage;
token: string;
};
export type TokenPayload = {
token?: string;
};