mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: add no expiration to token generated
This commit is contained in:
@@ -26,7 +26,7 @@ import {
|
||||
updateAuthById,
|
||||
verify2FA,
|
||||
} from "../services/auth";
|
||||
import { TimeSpan } from "lucia";
|
||||
import { luciaToken } from "@/server/auth/token";
|
||||
|
||||
export const authRouter = createTRPCRouter({
|
||||
createAdmin: publicProcedure
|
||||
@@ -143,9 +143,9 @@ export const authRouter = createTRPCRouter({
|
||||
const auth = await findAuthById(ctx.user.authId);
|
||||
|
||||
if (auth.token) {
|
||||
await lucia.invalidateSession(auth.token);
|
||||
await luciaToken.invalidateSession(auth.token);
|
||||
}
|
||||
const session = await lucia.createSession(auth?.id || "", {
|
||||
const session = await luciaToken.createSession(auth?.id || "", {
|
||||
expiresIn: 60 * 60 * 24 * 30,
|
||||
});
|
||||
|
||||
|
||||
@@ -13,9 +13,10 @@ import { TRPCError, initTRPC } from "@trpc/server";
|
||||
import type { CreateNextContextOptions } from "@trpc/server/adapters/next";
|
||||
import superjson from "superjson";
|
||||
import { ZodError } from "zod";
|
||||
import { validateBearerToken, validateRequest } from "../auth/auth";
|
||||
import { validateRequest } from "../auth/auth";
|
||||
import type { Session, User } from "lucia";
|
||||
import type { OperationMeta } from "openapi-trpc";
|
||||
import { validateBearerToken } from "../auth/token";
|
||||
|
||||
/**
|
||||
* 1. CONTEXT
|
||||
|
||||
Reference in New Issue
Block a user