Skip to content

Commit

Permalink
removes a few extra checks that are not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Sep 4, 2024
1 parent 63b3e19 commit 6420511
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
9 changes: 0 additions & 9 deletions lib/build/recipe/passwordless/recipeImplementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ function getRecipeInterface(querier) {
logger_1.logDebugMessage("Passwordless.consumeCode code consumed OK");
response.user = new user_1.User(response.user);
response.recipeUserId = new recipeUserId_1.default(response.recipeUserId);
if (response.status !== "OK") {
return response;
}
if (response.status !== "OK") {
return response;
}
// Attempt account linking (this is a sign up)
let updatedUser = response.user;
const linkResult = await authUtils_1.AuthUtils.linkToSessionIfProvidedElseCreatePrimaryUserIdOrLinkByAccountInfo(
Expand All @@ -58,9 +52,6 @@ function getRecipeInterface(querier) {
return linkResult;
}
updatedUser = linkResult.user;
if (updatedUser === undefined) {
throw new Error("Should never come here.");
}
response.user = updatedUser;
return Object.assign(Object.assign({}, response), {
consumedDevice: response.consumedDevice,
Expand Down
12 changes: 0 additions & 12 deletions lib/ts/recipe/passwordless/recipeImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface {
response.user = new User(response.user);
response.recipeUserId = new RecipeUserId(response.recipeUserId);

if (response.status !== "OK") {
return response;
}

if (response.status !== "OK") {
return response;
}

// Attempt account linking (this is a sign up)
let updatedUser = response.user;

Expand All @@ -64,10 +56,6 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface {
}
updatedUser = linkResult.user;

if (updatedUser === undefined) {
throw new Error("Should never come here.");
}

response.user = updatedUser;

return {
Expand Down

0 comments on commit 6420511

Please sign in to comment.