mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-20 20:06:39 +00:00
save
This commit is contained in:
@@ -10,7 +10,6 @@ import createHttpError from "http-errors";
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
import { verifyTotpCode } from "@server/auth/2fa";
|
import { verifyTotpCode } from "@server/auth/2fa";
|
||||||
import logger from "@server/logger";
|
|
||||||
|
|
||||||
export const loginBodySchema = z.object({
|
export const loginBodySchema = z.object({
|
||||||
email: z.string().email(),
|
email: z.string().email(),
|
||||||
|
|||||||
@@ -69,8 +69,6 @@ export default function LoginForm({ redirect }: LoginFormProps) {
|
|||||||
if (res && res.status === 200) {
|
if (res && res.status === 200) {
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
if (res.data?.data?.emailVerificationRequired) {
|
if (res.data?.data?.emailVerificationRequired) {
|
||||||
router.push("/auth/verify-email");
|
router.push("/auth/verify-email");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
import { GetUserResponse } from "@server/routers/user";
|
|
||||||
import { verifySession } from "./verifySession";
|
|
||||||
|
|
||||||
export async function isValidUser(): Promise<GetUserResponse | null> {
|
|
||||||
const user = await verifySession();
|
|
||||||
|
|
||||||
if (!user) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!user.emailVerified) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user