fix random auth errors

idk how i did it
This commit is contained in:
2025-08-16 22:15:22 -04:00
parent 1fe3ef0ee1
commit 1fdc20ee0c
2 changed files with 27 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
import NextAuth, { NextAuthConfig } from "next-auth";
import NextAuth, { NextAuthConfig, NextAuthResult } from "next-auth";
import Authentik from "next-auth/providers/authentik";
import type { Provider } from "next-auth/providers";
@@ -7,19 +7,6 @@ const providers: Provider[] = [
clientId: process.env.AUTH_AUTHENTIK_CLIENT_ID,
clientSecret: process.env.AUTH_AUTHENTIK_CLIENT_SECRET,
issuer: process.env.AUTH_AUTHENTIK_ISSUER,
authorization: {
params: {
scope: "openid email profile",
},
},
profile(profile) {
return {
id: profile.sub,
name: profile.name,
email: profile.email,
image: profile.picture,
};
},
}),
];
@@ -39,19 +26,5 @@ const config = {
signOut: "/signout",
},
trustHost: true,
// callbacks: {
// authorized({ auth, request: { nextUrl } }) {
// const isLoggedIn = !!auth?.user;
// const isOnProtectedRoute = nextUrl.pathname.startsWith("/api/ai-event");
//
// if (isOnProtectedRoute) {
// if (isLoggedIn) return true;
// return false;
// } else if (isLoggedIn) {
// return Response.redirect(new URL("/api/ai-event", nextUrl));
// }
// return true;
// },
// },
} satisfies NextAuthConfig;
export const { handlers, signIn, signOut, auth } = NextAuth(config);
export const { handlers, signIn, signOut, auth }: NextAuthResult = NextAuth(config);