Skip to content

Commit

Permalink
Merge pull request #13 from passageidentity/psg-3196-allowed-auth-met…
Browse files Browse the repository at this point in the history
…hods

Update AppInfo type with allowedAuthMethods
  • Loading branch information
flanagankp authored Nov 29, 2023
2 parents e449061 + 10abd79 commit 043bd85
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Updated appInfo type with new allowedAuthMethods property",
"packageName": "@passageidentity/passage-react-native",
"email": "[email protected]",
"dependentChangeType": "patch"
}
20 changes: 20 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export enum RequiredIdentifier {

export type PassageAppInfo = {
allowedIdentifier: Identifier;
/**
* @deprecated Check the authMethods property for the full list of supported authentication methods and their configurations.
*/
authFallbackMethod: AllowedFallbackAuth;
authOrigin: string;
id: string;
Expand All @@ -106,6 +109,11 @@ export type PassageAppInfo = {
requireIdentifierVerification: boolean;
sessionTimeoutLength: number;
userMetadataSchema: Array<PassageAppUserMetadataSchema> | null;
authMethods: {
passkeys?: Record<string, never>;
otp?: EmailAndSMSAuthMethod;
magicLink?: EmailAndSMSAuthMethod;
};
};

export type PassageAppUserMetadataSchema = {
Expand All @@ -117,6 +125,18 @@ export type PassageAppUserMetadataSchema = {
type: string;
};

export type EmailAndSMSAuthMethod = {
ttl: number;
ttl_display_unit: DisplayUnit;
};

export enum DisplayUnit {
Seconds = 's',
Minutes = 'm',
Hours = 'h',
Days = 'd',
}

type RegisterWithPasskey = (identifier: string) => Promise<AuthResult>;
type LoginWithPasskey = () => Promise<AuthResult>;
type DeviceSupportsPasskeys = () => Promise<boolean>;
Expand Down

0 comments on commit 043bd85

Please sign in to comment.