Skip to content

Commit

Permalink
feat: update to match new BE interface
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Jan 18, 2024
1 parent 7791cdc commit 953425b
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bundle/passwordless.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/thirdpartypasswordless.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/build/recipe/multifactorauth/types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/build/recipe/passwordless/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/build/recipe/passwordless/recipeImplementation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/build/recipe/passwordless/types.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/build/recipe/passwordless/utils.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/ts/recipe/multifactorauth/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export type NormalisedInputType = AuthRecipeNormalisedInputType<PreAndPostAPIHoo
};

export type MFAFactorInfo = {
isAlreadySetup: string[];
isAllowedToSetup: string[];
alreadySetup: string[];
allowedToSetup: string[];
next: string[];
};

Expand Down
4 changes: 2 additions & 2 deletions lib/ts/recipe/passwordless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export default class RecipeWrapper {
*/
static async createCode(
input:
| { email: string; userContext?: any; options?: RecipeFunctionOptions }
| { phoneNumber: string; userContext?: any; options?: RecipeFunctionOptions }
| { email: string; userContext?: any; factorIds?: string[]; options?: RecipeFunctionOptions }
| { phoneNumber: string; userContext?: any; factorIds?: string[]; options?: RecipeFunctionOptions }
): Promise<
| {
status: "OK";
Expand Down
6 changes: 4 additions & 2 deletions lib/ts/recipe/passwordless/recipeImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default function getRecipeImplementation(
return {
createCode: async function (
input:
| { email: string; userContext: any; options?: RecipeFunctionOptions }
| { phoneNumber: string; userContext: any; options?: RecipeFunctionOptions }
| { email: string; factorIds?: string[]; userContext: any; options?: RecipeFunctionOptions }
| { phoneNumber: string; factorIds?: string[]; userContext: any; options?: RecipeFunctionOptions }
): Promise<
| {
status: "OK";
Expand All @@ -51,12 +51,14 @@ export default function getRecipeImplementation(
if ("email" in input) {
bodyObj = {
email: input.email,
factorIds: input.factorIds,
};
}

if ("phoneNumber" in input) {
bodyObj = {
phoneNumber: input.phoneNumber,
factorIds: input.factorIds,
};
}

Expand Down
4 changes: 2 additions & 2 deletions lib/ts/recipe/passwordless/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export type RecipeInterface = {
*/
createCode: (
input:
| { email: string; userContext: any; options?: RecipeFunctionOptions }
| { phoneNumber: string; userContext: any; options?: RecipeFunctionOptions }
| { email: string; userContext: any; factorIds?: string[]; options?: RecipeFunctionOptions }
| { phoneNumber: string; userContext: any; factorIds?: string[]; options?: RecipeFunctionOptions }
) => Promise<
| {
status: "OK";
Expand Down
9 changes: 8 additions & 1 deletion lib/ts/recipe/passwordless/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ export function normaliseUserInput(config: InputType): NormalisedInputType {

export async function createCode(
input:
| { email: string; userContext?: any; options?: RecipeFunctionOptions; recipeImplementation: RecipeInterface }
| {
email: string;
factorIds?: string[];
userContext?: any;
options?: RecipeFunctionOptions;
recipeImplementation: RecipeInterface;
}
| {
phoneNumber: string;
factorIds?: string[];
userContext?: any;
options?: RecipeFunctionOptions;
recipeImplementation: RecipeInterface;
Expand Down

0 comments on commit 953425b

Please sign in to comment.