mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-09 20:35:28 +02:00
save
This commit is contained in:
parent
bdc52dcc48
commit
0e751c6609
3 changed files with 0 additions and 19 deletions
|
@ -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;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue