Skip to content

Commit

Permalink
adds a clarification comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhpoddar committed Aug 28, 2024
1 parent c89c3bb commit 2406b1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/build/recipe/emailpassword/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,15 @@ function getAPIImplementation() {
userContext,
});
if (postAuthChecks.status !== "OK") {
return authUtils_1.AuthUtils.getErrorStatusResponseWithReason(
// It should never actually come here, but we do it cause of consistency.
// If it does come here (in case there is a bug), it would make this func throw
// anyway, cause there is no SIGN_IN_NOT_ALLOWED in the errorCodeMap.
authUtils_1.AuthUtils.getErrorStatusResponseWithReason(
postAuthChecks,
errorCodeMap,
"SIGN_UP_NOT_ALLOWED"
);
throw new Error("This should never happen");
}
return {
status: "OK",
Expand Down
6 changes: 5 additions & 1 deletion lib/ts/recipe/emailpassword/api/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,11 @@ export default function getAPIImplementation(): APIInterface {
});

if (postAuthChecks.status !== "OK") {
return AuthUtils.getErrorStatusResponseWithReason(postAuthChecks, errorCodeMap, "SIGN_UP_NOT_ALLOWED");
// It should never actually come here, but we do it cause of consistency.
// If it does come here (in case there is a bug), it would make this func throw
// anyway, cause there is no SIGN_IN_NOT_ALLOWED in the errorCodeMap.
AuthUtils.getErrorStatusResponseWithReason(postAuthChecks, errorCodeMap, "SIGN_UP_NOT_ALLOWED");
throw new Error("This should never happen");
}

return {
Expand Down

0 comments on commit 2406b1d

Please sign in to comment.