2024-03-11 19:36:22 +08:00
|
|
|
import type { TDocumentAuth } from '../types/document-auth';
|
|
|
|
|
import { DocumentAuth } from '../types/document-auth';
|
|
|
|
|
|
|
|
|
|
type DocumentAuthTypeData = {
|
|
|
|
|
key: TDocumentAuth;
|
|
|
|
|
value: string;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether this authentication event will require the user to halt and
|
|
|
|
|
* redirect.
|
|
|
|
|
*
|
|
|
|
|
* Defaults to false.
|
|
|
|
|
*/
|
|
|
|
|
isAuthRedirectRequired?: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const DOCUMENT_AUTH_TYPES: Record<string, DocumentAuthTypeData> = {
|
|
|
|
|
[DocumentAuth.ACCOUNT]: {
|
|
|
|
|
key: DocumentAuth.ACCOUNT,
|
|
|
|
|
value: 'Require account',
|
|
|
|
|
isAuthRedirectRequired: true,
|
|
|
|
|
},
|
2024-03-27 16:13:22 +08:00
|
|
|
[DocumentAuth.PASSKEY]: {
|
|
|
|
|
key: DocumentAuth.PASSKEY,
|
|
|
|
|
value: 'Require passkey',
|
|
|
|
|
},
|
2024-03-11 19:36:22 +08:00
|
|
|
[DocumentAuth.EXPLICIT_NONE]: {
|
|
|
|
|
key: DocumentAuth.EXPLICIT_NONE,
|
|
|
|
|
value: 'None (Overrides global settings)',
|
|
|
|
|
},
|
|
|
|
|
} satisfies Record<TDocumentAuth, DocumentAuthTypeData>;
|