feat(auth): enterprise authentication and user management

This commit is contained in:
Schubert Ferenc 2026-07-02 22:19:12 +02:00
parent 4bc8b20a21
commit 86a32a942c
36 changed files with 2239 additions and 324 deletions

24
frontend/athena/proxy.ts Normal file
View file

@ -0,0 +1,24 @@
import { NextRequest, NextResponse } from "next/server";
export function proxy(request: NextRequest) {
const token = request.cookies.get("access_token");
const isLoginPage = request.nextUrl.pathname === "/login";
if (isLoginPage && token) {
return NextResponse.redirect(new URL("/dashboard", request.url));
}
if (!isLoginPage && !token) {
return NextResponse.redirect(new URL("/login", request.url));
}
return NextResponse.next();
}
export const config = {
matcher: [
"/login",
"/dashboard/:path*",
"/users/:path*",
],
};