Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expand the missing ui error message to provide more info on common errors #860

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added the `OAuth2Provider` recipe
- Changed the input types and default implementation of `AuthPageHeader` to show the client information in OAuth2 flows
- Expanded an error message in `AuthPage` to help with common errors

### Breaking changes

Expand Down
4 changes: 3 additions & 1 deletion lib/build/index2.js

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

Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,9 @@ async function buildAndSetChildProps(
throw new Error(
`Couldn't cover all first factors: ${firstFactors.join(
", "
)} (from ${source}), available components: ${Array.from(availableFactors).join(", ")}`
)} (from ${source}), available components: ${Array.from(availableFactors).join(", ")}.\n` +
"You may have missed adding a recipe into the list of prebuiltUIs passed to list of prebuiltUIs passed to getSuperTokensRoutesForReactRouterDom, canHandleRoute, handleRoute functions or the AuthPage component.\n" +
"Another common error is adding a non-existent factor id into the list, e.g.: passwordless instead of otp-email/phone"
);
}

Expand Down
4 changes: 2 additions & 2 deletions test/end-to-end/signin-rrdv5.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe("SuperTokens SignIn with react router dom v5", function () {
assert.strictEqual(request.headers().rid, "emailpassword");
assert.strictEqual(
request.postData(),
'{"formFields":[{"id":"email","value":"[email protected]"},{"id":"password","value":"********"}]}'
'{"formFields":[{"id":"email","value":"[email protected]"},{"id":"password","value":"********"}],"shouldTryLinkingWithSessionUser":false}'
);

assert.strictEqual(response.status, "WRONG_CREDENTIALS_ERROR");
Expand Down Expand Up @@ -272,7 +272,7 @@ describe("SuperTokens SignIn with react router dom v5", function () {
assert.strictEqual(request.headers().rid, "emailpassword");
assert.strictEqual(
request.postData(),
'{"formFields":[{"id":"email","value":"[email protected]"},{"id":"password","value":"Str0ngP@ssw0rd"}]}'
'{"formFields":[{"id":"email","value":"[email protected]"},{"id":"password","value":"Str0ngP@ssw0rd"}],"shouldTryLinkingWithSessionUser":false}'
);

assert.strictEqual(response.status, "OK");
Expand Down
Loading