fix user verification check

This commit is contained in:
Max Peintner
2025-05-21 11:42:52 +02:00
parent f6d546a8ea
commit f1cb621333
3 changed files with 5 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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:

View File

@@ -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;