This commit is contained in:
David Nguyen
2025-02-05 23:37:21 +11:00
parent 9c7910a070
commit 7effe66387
26 changed files with 1518 additions and 1951 deletions

View File

@ -1,8 +0,0 @@
import { env } from '@documenso/lib/utils/env';
// Todo: Delete
export const authDebugger = (message: string) => {
if (env('NODE_ENV') === 'development') {
// console.log(`[DEBUG]: ${message}`);
}
};

View File

@ -6,14 +6,11 @@ import { AuthenticationErrorCode } from '../errors/error-codes';
import type { SessionValidationResult } from '../session/session';
import { validateSessionToken } from '../session/session';
import { getSessionCookie } from '../session/session-cookies';
import { authDebugger } from './debugger';
export const getSession = async (c: Context | Request): Promise<SessionValidationResult> => {
// Todo: Make better
const sessionId = await getSessionCookie(mapRequestToContextForCookie(c));
authDebugger(`Session ID: ${sessionId}`);
if (!sessionId) {
return {
isAuthenticated: false,