Skip to content

Commit afcbeaf

Browse files
committed
small change
1 parent 9fbf1e8 commit afcbeaf

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

v2/emailpassword/common-customizations/change-email-post-login.mdx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ import EmailPassword from "supertokens-node/recipe/emailpassword";
112112
import { verifySession } from "supertokens-node/recipe/session/framework/express";
113113
import { SessionRequest } from "supertokens-node/framework/express"
114114
import express from "express";
115-
import {isEmailChangeAllowed} from "supertokens-node/recipe/accountlinking"
116115

117116
let app = express();
118117

@@ -127,11 +126,6 @@ app.post("/change-email", verifySession(), async (req: SessionRequest, res: expr
127126
// TODO: handle invalid email error
128127
return
129128
}
130-
131-
if (!(await isEmailChangeAllowed(session.getRecipeUserId(), email, false))) {
132-
// this can come here if you have enabled the account linking feature, and
133-
// if there is a security risk in changing this user's email.
134-
}
135129

136130
// Update the email
137131
let resp = await EmailPassword.updateEmailOrPassword({
@@ -457,12 +451,6 @@ app.post("/change-email", verifySession(), async (req: SessionRequest, res: expr
457451
return
458452
}
459453

460-
if (!(await isEmailChangeAllowed(session.getRecipeUserId(), email, true))) {
461-
// this can come here if you have enabled the account linking feature, and
462-
// if there is a security risk in changing this user's email.
463-
return res.status(400).send("Email change not allowed. Please contact support");
464-
}
465-
466454
// Since the email is verified, we try and do an update
467455
let resp = await EmailPassword.updateEmailOrPassword({
468456
recipeUserId: session.getRecipeUserId(),

v2/thirdpartyemailpassword/common-customizations/change-email-post-login.mdx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ import EmailPassword from "supertokens-node/recipe/emailpassword";
112112
import { verifySession } from "supertokens-node/recipe/session/framework/express";
113113
import { SessionRequest } from "supertokens-node/framework/express"
114114
import express from "express";
115-
import {isEmailChangeAllowed} from "supertokens-node/recipe/accountlinking"
116115

117116
let app = express();
118117

@@ -127,11 +126,6 @@ app.post("/change-email", verifySession(), async (req: SessionRequest, res: expr
127126
// TODO: handle invalid email error
128127
return
129128
}
130-
131-
if (!(await isEmailChangeAllowed(session.getRecipeUserId(), email, false))) {
132-
// this can come here if you have enabled the account linking feature, and
133-
// if there is a security risk in changing this user's email.
134-
}
135129

136130
// Update the email
137131
let resp = await EmailPassword.updateEmailOrPassword({
@@ -457,12 +451,6 @@ app.post("/change-email", verifySession(), async (req: SessionRequest, res: expr
457451
return
458452
}
459453

460-
if (!(await isEmailChangeAllowed(session.getRecipeUserId(), email, true))) {
461-
// this can come here if you have enabled the account linking feature, and
462-
// if there is a security risk in changing this user's email.
463-
return res.status(400).send("Email change not allowed. Please contact support");
464-
}
465-
466454
// Since the email is verified, we try and do an update
467455
let resp = await EmailPassword.updateEmailOrPassword({
468456
recipeUserId: session.getRecipeUserId(),

0 commit comments

Comments
 (0)