Skip to content

Commit 15dac20

Browse files
authored
fix: only show continue with passwordless if email pwless is enabled (#859)
1 parent 357d105 commit 15dac20

File tree

8 files changed

+30
-10
lines changed

8 files changed

+30
-10
lines changed

CHANGELOG.md

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

88
## [unreleased]
99

10+
## [0.47.1] - 2024-09-18
11+
12+
### Fixes
13+
14+
- Fixed an issue where we showed the "continue with passwordless" button during sign-in even if email-based passwordless was disabled by the tenant configuration.
15+
1016
## [0.47.0] - 2024-09-02
1117

1218
### 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/passwordlessprebuiltui.js

Lines changed: 9 additions & 2 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/passwordless/components/features/signInAndUpEPCombo/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { getRedirectToPathFromURL, useRethrowInRender, validateForm } from "../.
2626
import EmailPassword from "../../../../emailpassword/recipe";
2727
import { EmailVerificationClaim } from "../../../../emailverification";
2828
import EmailVerification from "../../../../emailverification/recipe";
29+
import { FactorIds } from "../../../../multifactorauth";
2930
import { getInvalidClaimsFromResponse } from "../../../../session";
3031
import SessionRecipe from "../../../../session/recipe";
3132
import Session from "../../../../session/recipe";
@@ -61,6 +62,10 @@ export function useChildProps(
6162
const rethrowInRender = useRethrowInRender();
6263

6364
return useMemo(() => {
65+
const isPasswordlessEmailEnabled = [FactorIds.LINK_EMAIL, FactorIds.OTP_EMAIL].some((id) =>
66+
factorIds.includes(id)
67+
);
68+
6469
return {
6570
isPhoneNumber,
6671
setIsPhoneNumber: (isPhone) => {
@@ -85,7 +90,7 @@ export function useChildProps(
8590
}
8691
}
8792
const email = contactInfo;
88-
if (recipe.config.contactMethod === "PHONE") {
93+
if (recipe.config.contactMethod === "PHONE" || !isPasswordlessEmailEnabled) {
8994
setShowPasswordField(true);
9095
return { status: "OK" };
9196
}
@@ -114,7 +119,9 @@ export function useChildProps(
114119
}
115120
} else {
116121
setShowPasswordField(true);
117-
setShowContinueWithPasswordlessLink(true);
122+
if (isPasswordlessEmailEnabled) {
123+
setShowContinueWithPasswordlessLink(true);
124+
}
118125
return { status: "OK" };
119126
}
120127
},

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.47.0";
15+
export const package_version = "0.47.1";

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.47.0",
3+
"version": "0.47.1",
44
"description": "ReactJS SDK that provides login functionality with SuperTokens.",
55
"main": "./index.js",
66
"engines": {

0 commit comments

Comments
 (0)