Skip to content

Commit

Permalink
feat: expand the missing ui error message to provide more info on com…
Browse files Browse the repository at this point in the history
…mon errors (#860)

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

* test: fix react 16 tests

* feat: expand the error message a bit more
  • Loading branch information
porcellus authored Oct 4, 2024
1 parent 43086e8 commit e721eae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
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

0 comments on commit e721eae

Please sign in to comment.