Skip to content

Commit

Permalink
Revert "fix: improve error messages when the authpage has issues cove…
Browse files Browse the repository at this point in the history
…ring all…" (#848)

This reverts commit b6f4657.
  • Loading branch information
porcellus authored Aug 11, 2024
1 parent b6f4657 commit 4372b66
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 95 deletions.
6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

## [0.45.1] - 2024-08-09

### Changes

- Now we only update the session context if the object changes by value. This optimization should help reduce unnecessary re-renders.

## [0.45.0] - 2024-07-31

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion lib/build/genericComponentOverrideContext.js

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

67 changes: 13 additions & 54 deletions lib/build/index2.js

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

2 changes: 1 addition & 1 deletion lib/build/version.d.ts

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 @@ -354,10 +354,6 @@ async function buildAndSetChildProps(
}
}

if (firstFactors.length === 0) {
throw new Error("There are no enabled factors to show");
}

if (firstFactors.includes(FactorIds.THIRDPARTY)) {
// we get the thirdparty recipe here like this, because importing the recipe here would heavily increase the bundle size of many recipes
const thirdPartyPreBuiltUI = recipeRouters.find((r) => r.recipeInstance.recipeID === FactorIds.THIRDPARTY);
Expand All @@ -372,11 +368,6 @@ async function buildAndSetChildProps(
(!SuperTokens.usesDynamicLoginMethods || loadedDynamicLoginMethods!.thirdparty.providers.length === 0)
) {
firstFactors = firstFactors.filter((f) => f !== FactorIds.THIRDPARTY);
if (firstFactors.length === 0) {
throw new Error(
"The only enabled first factor is thirdparty, but no providers were defined. Please define at least one provider."
);
}
}
}
}
Expand Down Expand Up @@ -444,26 +435,7 @@ async function buildAndSetChildProps(
const selectedComponents = selectComponentsToCoverAllFirstFactors(partialAuthComps, firstFactors);

if (selectedComponents === undefined) {
const availableFactors = new Set();
for (const comp of partialAuthComps) {
for (const id of comp.factorIds) {
availableFactors.add(id);
}
}
const source =
factorListState !== undefined
? "local state or props"
: loadedDynamicLoginMethods?.firstFactors !== undefined
? "dynamic tenant configuration"
: MultiFactorAuth.getInstance()?.config.firstFactors !== undefined
? "the config passed to the MFA recipe"
: "all recipes initialized";

throw new Error(
`Couldn't cover all first factors: ${firstFactors.join(
", "
)} (from ${source}), available components: ${Array.from(availableFactors).join(", ")}`
);
throw new Error("Couldn't cover all first factors");
}

setComponentListInfo({
Expand Down
2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const package_version = "0.45.1";
export const package_version = "0.45.0";
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "supertokens-auth-react",
"version": "0.45.1",
"version": "0.45.0",
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
"main": "./index.js",
"engines": {
Expand Down

0 comments on commit 4372b66

Please sign in to comment.