Skip to content

Commit 4372b66

Browse files
authored
Revert "fix: improve error messages when the authpage has issues covering all…" (#848)
This reverts commit b6f4657.
1 parent b6f4657 commit 4372b66

File tree

8 files changed

+20
-95
lines changed

8 files changed

+20
-95
lines changed

CHANGELOG.md

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

88
## [unreleased]
99

10-
## [0.45.1] - 2024-08-09
11-
12-
### Changes
13-
14-
- Now we only update the session context if the object changes by value. This optimization should help reduce unnecessary re-renders.
15-
1610
## [0.45.0] - 2024-07-31
1711

1812
### Breaking changes

lib/build/genericComponentOverrideContext.js

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

lib/build/index2.js

Lines changed: 13 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/build/version.d.ts

Lines changed: 1 addition & 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: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,6 @@ async function buildAndSetChildProps(
354354
}
355355
}
356356

357-
if (firstFactors.length === 0) {
358-
throw new Error("There are no enabled factors to show");
359-
}
360-
361357
if (firstFactors.includes(FactorIds.THIRDPARTY)) {
362358
// we get the thirdparty recipe here like this, because importing the recipe here would heavily increase the bundle size of many recipes
363359
const thirdPartyPreBuiltUI = recipeRouters.find((r) => r.recipeInstance.recipeID === FactorIds.THIRDPARTY);
@@ -372,11 +368,6 @@ async function buildAndSetChildProps(
372368
(!SuperTokens.usesDynamicLoginMethods || loadedDynamicLoginMethods!.thirdparty.providers.length === 0)
373369
) {
374370
firstFactors = firstFactors.filter((f) => f !== FactorIds.THIRDPARTY);
375-
if (firstFactors.length === 0) {
376-
throw new Error(
377-
"The only enabled first factor is thirdparty, but no providers were defined. Please define at least one provider."
378-
);
379-
}
380371
}
381372
}
382373
}
@@ -444,26 +435,7 @@ async function buildAndSetChildProps(
444435
const selectedComponents = selectComponentsToCoverAllFirstFactors(partialAuthComps, firstFactors);
445436

446437
if (selectedComponents === undefined) {
447-
const availableFactors = new Set();
448-
for (const comp of partialAuthComps) {
449-
for (const id of comp.factorIds) {
450-
availableFactors.add(id);
451-
}
452-
}
453-
const source =
454-
factorListState !== undefined
455-
? "local state or props"
456-
: loadedDynamicLoginMethods?.firstFactors !== undefined
457-
? "dynamic tenant configuration"
458-
: MultiFactorAuth.getInstance()?.config.firstFactors !== undefined
459-
? "the config passed to the MFA recipe"
460-
: "all recipes initialized";
461-
462-
throw new Error(
463-
`Couldn't cover all first factors: ${firstFactors.join(
464-
", "
465-
)} (from ${source}), available components: ${Array.from(availableFactors).join(", ")}`
466-
);
438+
throw new Error("Couldn't cover all first factors");
467439
}
468440

469441
setComponentListInfo({

lib/ts/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
* License for the specific language governing permissions and limitations
1313
* under the License.
1414
*/
15-
export const package_version = "0.45.1";
15+
export const package_version = "0.45.0";

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "supertokens-auth-react",
3-
"version": "0.45.1",
3+
"version": "0.45.0",
44
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
55
"main": "./index.js",
66
"engines": {

0 commit comments

Comments
 (0)