Skip to content

Commit e721eae

Browse files
authored
feat: expand the missing ui error message to provide more info on common 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
1 parent 43086e8 commit e721eae

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

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

1718
### Breaking changes
1819

lib/build/index2.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ts/recipe/authRecipe/components/feature/authPage/authPage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,9 @@ async function buildAndSetChildProps(
569569
throw new Error(
570570
`Couldn't cover all first factors: ${firstFactors.join(
571571
", "
572-
)} (from ${source}), available components: ${Array.from(availableFactors).join(", ")}`
572+
)} (from ${source}), available components: ${Array.from(availableFactors).join(", ")}.\n` +
573+
"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" +
574+
"Another common error is adding a non-existent factor id into the list, e.g.: passwordless instead of otp-email/phone"
573575
);
574576
}
575577

test/end-to-end/signin-rrdv5.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ describe("SuperTokens SignIn with react router dom v5", function () {
191191
assert.strictEqual(request.headers().rid, "emailpassword");
192192
assert.strictEqual(
193193
request.postData(),
194-
'{"formFields":[{"id":"email","value":"[email protected]"},{"id":"password","value":"********"}]}'
194+
'{"formFields":[{"id":"email","value":"[email protected]"},{"id":"password","value":"********"}],"shouldTryLinkingWithSessionUser":false}'
195195
);
196196

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

278278
assert.strictEqual(response.status, "OK");

0 commit comments

Comments
 (0)