Skip to content

Commit

Permalink
chore: update error code reason strings
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Feb 19, 2024
1 parent 66c428d commit a5f28e3
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 50 deletions.
18 changes: 10 additions & 8 deletions lib/build/recipe/emailpassword/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,14 @@ function getAPIImplementation() {
SIGN_IN_NOT_ALLOWED:
"Cannot sign in due to security reasons. Please try resetting your password, use a different login method or contact support. (ERR_CODE_008)",
LINKING_TO_SESSION_USER_FAILED: {
EMAIL_VERIFICATION_REQUIRED: "User linking failed. Please contact support. (ERR_CODE_009)",
EMAIL_VERIFICATION_REQUIRED:
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_009)",
RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_010)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_010)",
ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_011)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_011)",
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_012)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_012)",
},
};
let email = formFields.filter((f) => f.id === "email")[0].value;
Expand Down Expand Up @@ -569,13 +570,14 @@ function getAPIImplementation() {
SIGN_UP_NOT_ALLOWED:
"Cannot sign up due to security reasons. Please try logging in, use a different login method or contact support. (ERR_CODE_007)",
LINKING_TO_SESSION_USER_FAILED: {
EMAIL_VERIFICATION_REQUIRED: "User linking failed. Please contact support. (ERR_CODE_013)",
EMAIL_VERIFICATION_REQUIRED:
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_013)",
RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_014)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_014)",
ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_015)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_015)",
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_016)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_016)",
},
};
let email = formFields.filter((f) => f.id === "email")[0].value;
Expand Down
8 changes: 4 additions & 4 deletions lib/build/recipe/passwordless/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ function getAPIImplementation() {
// We should never get an email verification error here, since pwless automatically marks the user
// email as verified
RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_017)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_017)",
ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_018)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_018)",
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_019)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_019)",
},
};
const deviceInfo = await input.options.recipeImplementation.listCodesByPreAuthSessionId({
Expand Down Expand Up @@ -194,7 +194,7 @@ function getAPIImplementation() {
"Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_002)",
LINKING_TO_SESSION_USER_FAILED: {
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_019)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_019)",
},
};
const accountInfo = {};
Expand Down
9 changes: 5 additions & 4 deletions lib/build/recipe/thirdparty/api/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ function getAPIInterface() {
SIGN_IN_NOT_ALLOWED:
"Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)",
LINKING_TO_SESSION_USER_FAILED: {
EMAIL_VERIFICATION_REQUIRED: "User linking failed. Please contact support. (ERR_CODE_020)",
EMAIL_VERIFICATION_REQUIRED:
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_020)",
RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_021)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_021)",
ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_022)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_022)",
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_023)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_023)",
},
};
const { provider, tenantId, options, session, userContext } = input;
Expand Down
18 changes: 10 additions & 8 deletions lib/ts/recipe/emailpassword/api/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,14 @@ export default function getAPIImplementation(): APIInterface {
SIGN_IN_NOT_ALLOWED:
"Cannot sign in due to security reasons. Please try resetting your password, use a different login method or contact support. (ERR_CODE_008)",
LINKING_TO_SESSION_USER_FAILED: {
EMAIL_VERIFICATION_REQUIRED: "User linking failed. Please contact support. (ERR_CODE_009)",
EMAIL_VERIFICATION_REQUIRED:
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_009)",
RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_010)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_010)",
ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_011)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_011)",
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_012)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_012)",
},
};
let email = formFields.filter((f) => f.id === "email")[0].value;
Expand Down Expand Up @@ -730,13 +731,14 @@ export default function getAPIImplementation(): APIInterface {
SIGN_UP_NOT_ALLOWED:
"Cannot sign up due to security reasons. Please try logging in, use a different login method or contact support. (ERR_CODE_007)",
LINKING_TO_SESSION_USER_FAILED: {
EMAIL_VERIFICATION_REQUIRED: "User linking failed. Please contact support. (ERR_CODE_013)",
EMAIL_VERIFICATION_REQUIRED:
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_013)",
RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_014)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_014)",
ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_015)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_015)",
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_016)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_016)",
},
};
let email = formFields.filter((f) => f.id === "email")[0].value;
Expand Down
8 changes: 4 additions & 4 deletions lib/ts/recipe/passwordless/api/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export default function getAPIImplementation(): APIInterface {
// We should never get an email verification error here, since pwless automatically marks the user
// email as verified
RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_017)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_017)",
ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_018)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_018)",
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_019)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_019)",
},
};

Expand Down Expand Up @@ -190,7 +190,7 @@ export default function getAPIImplementation(): APIInterface {
"Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_002)",
LINKING_TO_SESSION_USER_FAILED: {
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_019)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_019)",
},
};
const accountInfo: { phoneNumber?: string; email?: string } = {};
Expand Down
9 changes: 5 additions & 4 deletions lib/ts/recipe/thirdparty/api/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ export default function getAPIInterface(): APIInterface {
SIGN_IN_NOT_ALLOWED:
"Cannot sign in / up due to security reasons. Please try a different login method or contact support. (ERR_CODE_004)",
LINKING_TO_SESSION_USER_FAILED: {
EMAIL_VERIFICATION_REQUIRED: "User linking failed. Please contact support. (ERR_CODE_020)",
EMAIL_VERIFICATION_REQUIRED:
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_020)",
RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_021)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_021)",
ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_022)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_022)",
SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR:
"User linking failed. Please contact support. (ERR_CODE_023)",
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_023)",
},
};
const { provider, tenantId, options, session, userContext } = input;
Expand Down
9 changes: 6 additions & 3 deletions test/accountlinking-with-session/emailpasswordapis.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ describe(`emailpassword accountlinkingTests w/ session: ${printPath(

const body = resp.body;
assert.strictEqual(body.status, "SIGN_UP_NOT_ALLOWED");
assert.strictEqual(body.reason, "User linking failed. Please contact support. (ERR_CODE_016)");
assert.strictEqual(
body.reason,
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_016)"
);
});

it("should error if sign up is not allowed", async () => {
Expand Down Expand Up @@ -406,7 +409,7 @@ describe(`emailpassword accountlinkingTests w/ session: ${printPath(

// const body = resp.body;
// assert.strictEqual(body.status, "SIGN_IN_UP_NOT_ALLOWED");
// assert.strictEqual(body.reason, "User linking failed. Please contact support. (ERR_CODE_0XZ)");
// assert.strictEqual(body.reason, "Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_0XZ)");
// });

// it("should error if the session user cannot be made primary - email verification", async () => {
Expand Down Expand Up @@ -456,7 +459,7 @@ describe(`emailpassword accountlinkingTests w/ session: ${printPath(
// const body = resp.body;
// assert.deepStrictEqual(body, {
// status: "SIGN_IN_UP_NOT_ALLOWED",
// reason: "User linking failed. Please contact support. (ERR_CODE_0XX)",
// reason: "Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_0XX)",
// });
// });

Expand Down
19 changes: 14 additions & 5 deletions test/accountlinking-with-session/passwordlessapis.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ describe(`passwordless accountlinkingTests w/ session: ${printPath(

const body = resp.body;
assert.strictEqual(body.status, "SIGN_IN_UP_NOT_ALLOWED");
assert.strictEqual(body.reason, "User linking failed. Please contact support. (ERR_CODE_019)");
assert.strictEqual(
body.reason,
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_019)"
);
});

it("should error if the session user cannot be made primary - email verification", async () => {
Expand Down Expand Up @@ -152,7 +155,7 @@ describe(`passwordless accountlinkingTests w/ session: ${printPath(
const body = resp.body;
assert.deepStrictEqual(body, {
status: "SIGN_IN_UP_NOT_ALLOWED",
reason: "User linking failed. Please contact support. (ERR_CODE_018)",
reason: "Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_018)",
});
});

Expand Down Expand Up @@ -419,7 +422,10 @@ describe(`passwordless accountlinkingTests w/ session: ${printPath(

const body = resp.body;
assert.strictEqual(body.status, "SIGN_IN_UP_NOT_ALLOWED");
assert.strictEqual(body.reason, "User linking failed. Please contact support. (ERR_CODE_019)");
assert.strictEqual(
body.reason,
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_019)"
);
});

it("should error if the session user cannot be made primary - email verification", async () => {
Expand Down Expand Up @@ -471,7 +477,7 @@ describe(`passwordless accountlinkingTests w/ session: ${printPath(
const body = resp.body;
assert.deepStrictEqual(body, {
status: "SIGN_IN_UP_NOT_ALLOWED",
reason: "User linking failed. Please contact support. (ERR_CODE_017)",
reason: "Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_017)",
});
});

Expand Down Expand Up @@ -824,7 +830,10 @@ describe(`passwordless accountlinkingTests w/ session: ${printPath(

const body = resp.body;
assert.strictEqual(body.status, "SIGN_IN_UP_NOT_ALLOWED");
assert.strictEqual(body.reason, "User linking failed. Please contact support. (ERR_CODE_019)");
assert.strictEqual(
body.reason,
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_019)"
);
});

it("should error if the session user cannot be made primary - email verification", async () => {
Expand Down
14 changes: 10 additions & 4 deletions test/accountlinking-with-session/thirdpartyapis.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ describe(`thirdparty accountlinkingTests w/ session: ${printPath(

const body = resp.body;
assert.strictEqual(body.status, "SIGN_IN_UP_NOT_ALLOWED");
assert.strictEqual(body.reason, "User linking failed. Please contact support. (ERR_CODE_023)");
assert.strictEqual(
body.reason,
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_023)"
);
});

it("should error if the session user cannot be made primary - email verification", async () => {
Expand Down Expand Up @@ -147,7 +150,7 @@ describe(`thirdparty accountlinkingTests w/ session: ${printPath(
const body = resp.body;
assert.deepStrictEqual(body, {
status: "SIGN_IN_UP_NOT_ALLOWED",
reason: "User linking failed. Please contact support. (ERR_CODE_021)",
reason: "Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_021)",
});
});

Expand Down Expand Up @@ -405,7 +408,10 @@ describe(`thirdparty accountlinkingTests w/ session: ${printPath(

const body = resp.body;
assert.strictEqual(body.status, "SIGN_IN_UP_NOT_ALLOWED");
assert.strictEqual(body.reason, "User linking failed. Please contact support. (ERR_CODE_023)");
assert.strictEqual(
body.reason,
"Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_023)"
);
});

it("should error if the session user cannot be made primary - email verification", async () => {
Expand Down Expand Up @@ -455,7 +461,7 @@ describe(`thirdparty accountlinkingTests w/ session: ${printPath(
const body = resp.body;
assert.deepStrictEqual(body, {
status: "SIGN_IN_UP_NOT_ALLOWED",
reason: "User linking failed. Please contact support. (ERR_CODE_021)",
reason: "Cannot sign in / up due to security reasons. Please contact support. (ERR_CODE_021)",
});
});

Expand Down
Loading

0 comments on commit a5f28e3

Please sign in to comment.