mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 11:47:34 +00:00
fix user verification check
This commit is contained in:
@@ -275,7 +275,7 @@ export async function sendLoginname(command: SendLoginnameCommand) {
|
||||
if (!isUserVerified) {
|
||||
const params = new URLSearchParams({
|
||||
loginName: session.factors?.user?.loginName as string,
|
||||
// send: "true", // set this to true to request a new code immediately
|
||||
send: "true", // set this to true to request a new code immediately
|
||||
});
|
||||
|
||||
if (command.requestId) {
|
||||
|
@@ -6,7 +6,6 @@ import {
|
||||
getSession,
|
||||
getUserByID,
|
||||
listAuthenticationMethodTypes,
|
||||
resendEmailCode,
|
||||
verifyEmail,
|
||||
verifyInviteCode,
|
||||
verifyTOTPRegistration,
|
||||
@@ -283,7 +282,7 @@ export async function resendVerification(command: resendVerifyEmailCommand) {
|
||||
`${host.includes("localhost") ? "http://" : "https://"}${host}${basePath}/verify?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}&invite=true` +
|
||||
(command.requestId ? `&requestId=${command.requestId}` : ""),
|
||||
}) //resendInviteCode({ serviceUrl, userId: command.userId })
|
||||
: resendEmailCode({
|
||||
: sendEmailCode({
|
||||
userId: command.userId,
|
||||
serviceUrl,
|
||||
urlTemplate:
|
||||
|
@@ -258,15 +258,15 @@ export async function checkUserVerification(userId: string): Promise<boolean> {
|
||||
const cookiesList = await cookies();
|
||||
|
||||
// only read cookie to prevent issues on page.tsx
|
||||
const userAgentId = await getFingerprintIdCookie();
|
||||
const fingerPrintCookie = await getFingerprintIdCookie();
|
||||
|
||||
if (!userAgentId || userAgentId.value) {
|
||||
if (!fingerPrintCookie || !fingerPrintCookie.value) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const verificationCheck = crypto
|
||||
.createHash("sha256")
|
||||
.update(`${userId}:${userAgentId}`)
|
||||
.update(`${userId}:${fingerPrintCookie.value}`)
|
||||
.digest("hex");
|
||||
|
||||
const cookieValue = await cookiesList.get("verificationCheck")?.value;
|
||||
|
Reference in New Issue
Block a user