+
Processing authentication...
+
Please wait while we complete your login.
+
+
+
+
+
\ No newline at end of file
diff --git a/src/utils/auth.ts b/src/utils/auth.ts
new file mode 100644
index 0000000..c9c28bd
--- /dev/null
+++ b/src/utils/auth.ts
@@ -0,0 +1,176 @@
+import { SignJWT, jwtVerify, type JWTPayload } from 'jose';
+import { serialize, parse } from 'cookie';
+import { config } from 'dotenv';
+
+// Load environment variables
+config();
+
+// Environment variables - use runtime access for server-side
+function getEnv(key: string): string {
+ const value = process.env[key];
+ if (!value) {
+ throw new Error(`Missing environment variable: ${key}`);
+ }
+ return value;
+}
+
+const SECRET_KEY = new TextEncoder().encode(getEnv('OIDC_CLIENT_SECRET'));
+const SESSION_DURATION = 6 * 60 * 60; // 6 hours in seconds
+
+export interface SessionData {
+ userId: string;
+ authenticated: boolean;
+ exp: number;
+}
+
+// Create a signed JWT session token
+export async function createSession(userId: string): Promise