Skip to content

Commit

Permalink
fix sign in adn removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
niftyvictor committed Feb 7, 2025
1 parent 8baa775 commit 538b5ca
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 19 deletions.
1 change: 0 additions & 1 deletion lib/build/authUtils.js

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

7 changes: 0 additions & 7 deletions lib/build/recipe/webauthn/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ function getAPIImplementation() {
tenantId,
userContext,
});
console.log("generatedOptions", generatedOptions);
if (generatedOptions.status !== "OK") {
return {
status: "INVALID_CREDENTIALS_ERROR",
Expand Down Expand Up @@ -342,7 +341,6 @@ function getAPIImplementation() {
// the implementation of that function, this way we can guarantee that either isSignInAllowed or
// isSignUpAllowed will be called as expected.
if (authenticatingUser === undefined) {
console.log("authenticatingUser is undefined");
return {
status: "INVALID_CREDENTIALS_ERROR",
};
Expand Down Expand Up @@ -392,7 +390,6 @@ function getAPIImplementation() {
}
if (utils_1.isFakeEmail(email) && preAuthChecks.isFirstFactor) {
// Fake emails cannot be used as a first factor
console.log("isFakeEmail(email) && preAuthChecks.isFirstFactor");
return {
status: "INVALID_CREDENTIALS_ERROR",
};
Expand All @@ -405,13 +402,10 @@ function getAPIImplementation() {
tenantId,
userContext,
});
console.log("signInPOST signInResponse", signInResponse);
if (signInResponse.status === "INVALID_CREDENTIALS_ERROR") {
console.log("signInResponse.status === 'INVALID_CREDENTIALS_ERROR'");
return signInResponse;
}
if (signInResponse.status !== "OK") {
console.log("signInResponse.status !== 'OK'");
return authUtils_1.AuthUtils.getErrorStatusResponseWithReason(
signInResponse,
errorCodeMap,
Expand All @@ -430,7 +424,6 @@ function getAPIImplementation() {
userContext,
});
if (postAuthChecks.status !== "OK") {
console.log("postAuthChecks.status !== 'OK'", postAuthChecks);
return authUtils_1.AuthUtils.getErrorStatusResponseWithReason(
postAuthChecks,
errorCodeMap,
Expand Down
1 change: 0 additions & 1 deletion lib/build/recipe/webauthn/recipeImplementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ function getRecipeInterface(querier, getWebauthnConfig) {
},
userContext
);
console.log("response", response);
if (response.status === "OK") {
return {
status: "OK",
Expand Down
1 change: 0 additions & 1 deletion lib/ts/authUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ export const AuthUtils = {
logDebugMessage(
`getAuthenticatingUserAndAddToCurrentTenantIfRequired got ${existingUsers.length} users from the core resp`
);
console.log("existingUsers", existingUsers, accountInfo);
const usersWithMatchingLoginMethods = existingUsers
.map((user) => ({
user,
Expand Down
7 changes: 0 additions & 7 deletions lib/ts/recipe/webauthn/api/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ export default function getAPIImplementation(): APIInterface {
tenantId,
userContext,
});
console.log("generatedOptions", generatedOptions);
if (generatedOptions.status !== "OK") {
return {
status: "INVALID_CREDENTIALS_ERROR",
Expand Down Expand Up @@ -461,7 +460,6 @@ export default function getAPIImplementation(): APIInterface {
// the implementation of that function, this way we can guarantee that either isSignInAllowed or
// isSignUpAllowed will be called as expected.
if (authenticatingUser === undefined) {
console.log("authenticatingUser is undefined");
return {
status: "INVALID_CREDENTIALS_ERROR",
};
Expand Down Expand Up @@ -500,7 +498,6 @@ export default function getAPIImplementation(): APIInterface {

if (isFakeEmail(email) && preAuthChecks.isFirstFactor) {
// Fake emails cannot be used as a first factor
console.log("isFakeEmail(email) && preAuthChecks.isFirstFactor");
return {
status: "INVALID_CREDENTIALS_ERROR",
};
Expand All @@ -514,14 +511,11 @@ export default function getAPIImplementation(): APIInterface {
tenantId,
userContext,
});
console.log("signInPOST signInResponse", signInResponse);

if (signInResponse.status === "INVALID_CREDENTIALS_ERROR") {
console.log("signInResponse.status === 'INVALID_CREDENTIALS_ERROR'");
return signInResponse;
}
if (signInResponse.status !== "OK") {
console.log("signInResponse.status !== 'OK'");
return AuthUtils.getErrorStatusResponseWithReason(signInResponse, errorCodeMap, "SIGN_IN_NOT_ALLOWED");
}

Expand All @@ -538,7 +532,6 @@ export default function getAPIImplementation(): APIInterface {
});

if (postAuthChecks.status !== "OK") {
console.log("postAuthChecks.status !== 'OK'", postAuthChecks);
return AuthUtils.getErrorStatusResponseWithReason(postAuthChecks, errorCodeMap, "SIGN_IN_NOT_ALLOWED");
}

Expand Down
2 changes: 0 additions & 2 deletions lib/ts/recipe/webauthn/recipeImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ export default function getRecipeInterface(
userContext
);

console.log("response", response);

if (response.status === "OK") {
return {
status: "OK",
Expand Down
3 changes: 3 additions & 0 deletions test/webauthn/apis.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ describe(`apisFunctions: ${printPath("[test/webauthn/apis.test.js]")}`, function

assert(signInResponse.status === "INVALID_CREDENTIALS_ERROR");
});

it("should fail signIn if there is no credential registered for the user", async function () {});
it("should allow signIn multiple times with the same credential", async function () {});
});

describe("[generateRecoverAccountTokenPOST]", function () {
Expand Down

0 comments on commit 538b5ca

Please sign in to comment.