Skip to content

Commit

Permalink
Add initial types for wrapper methods around webauthn methods
Browse files Browse the repository at this point in the history
  • Loading branch information
deepjyoti30-st committed Dec 10, 2024
1 parent 6854d4d commit 6403de1
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions lib/ts/recipe/webauthn/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,75 @@ export type RecipeInterface = {
| { status: "INVALID_GENERATED_OPTIONS_ERROR"; fetchResponse: Response }
| { status: "INVALID_AUTHENTICATOR_ERROR"; reason: string; fetchResponse: Response }
>;
registerAndSignUp: (input: { email: string; options?: RecipeFunctionOptions; userContext: any }) => Promise<
| {
status: "OK";
user: User;
fetchResponse: Response;
}
| {
status: "INVALID_EMAIL_ERROR";
err: string;
fetchResponse: Response;
}
| {
status: "INVALID_GENERATED_OPTIONS_ERROR";
fetchResponse: Response;
}
| GeneralErrorResponse
| {
status: "SIGN_UP_NOT_ALLOWED";
reason: string;
fetchResponse: Response;
}
| { status: "INVALID_CREDENTIALS_ERROR"; fetchResponse: Response }
| { status: "GENERATED_OPTIONS_NOT_FOUND_ERROR"; fetchResponse: Response }
| { status: "INVALID_GENERATED_OPTIONS_ERROR"; fetchResponse: Response }
| { status: "INVALID_AUTHENTICATOR_ERROR"; reason: string; fetchResponse: Response }
| { status: "EMAIL_ALREADY_EXISTS_ERROR"; fetchResponse: Response }
>;
authenticateAndSignIn: (input: { email: string; options?: RecipeFunctionOptions; userContext: any }) => Promise<
| {
status: "OK";
user: User;
fetchResponse: Response;
}
| {
status: "INVALID_GENERATED_OPTIONS_ERROR";
fetchResponse: Response;
}
| { status: "INVALID_CREDENTIALS_ERROR"; fetchResponse: Response }
| {
status: "SIGN_IN_NOT_ALLOWED";
reason: string;
fetchResponse: Response;
}
| GeneralErrorResponse
>;
registerAndRecoverAccount: (input: {
recoverAccountToken: string;
options?: RecipeFunctionOptions;
userContext: any;
}) => Promise<
| {
status: "OK";
user: User;
email: string;
fetchResponse: Response;
}
| {
status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR";
fetchResponse: Response;
}
| {
status: "INVALID_GENERATED_OPTIONS_ERROR";
fetchResponse: Response;
}
| GeneralErrorResponse
| { status: "RECOVER_ACCOUNT_TOKEN_INVALID_ERROR"; fetchResponse: Response }
| { status: "INVALID_CREDENTIALS_ERROR"; fetchResponse: Response }
| { status: "GENERATED_OPTIONS_NOT_FOUND_ERROR"; fetchResponse: Response }
| { status: "INVALID_GENERATED_OPTIONS_ERROR"; fetchResponse: Response }
| { status: "INVALID_AUTHENTICATOR_ERROR"; reason: string; fetchResponse: Response }
>;
};

0 comments on commit 6403de1

Please sign in to comment.