diff --git a/app/auth/callback/unilogin/route.ts b/app/auth/callback/unilogin/route.ts index 0262a238..8e06d96b 100644 --- a/app/auth/callback/unilogin/route.ts +++ b/app/auth/callback/unilogin/route.ts @@ -1,6 +1,7 @@ import { NextRequest } from "next/server" import { IntrospectionResponse } from "openid-client" +import goConfig from "@/lib/config/config" import { getUniloginClient, uniloginClientConfig } from "@/lib/session/oauth/uniloginClient" import { getSession, setTokensOnSession } from "@/lib/session/session" import { TTokenSet } from "@/lib/types/session" @@ -52,6 +53,6 @@ export async function GET(request: NextRequest) { } catch (error) { console.error(error) // TODO: Error page or redirect to login page. - return Response.redirect("/") + return Response.redirect(goConfig("app.url")) } } diff --git a/app/auth/logout/route.ts b/app/auth/logout/route.ts index 7edd5943..82c4e7d2 100644 --- a/app/auth/logout/route.ts +++ b/app/auth/logout/route.ts @@ -1,6 +1,7 @@ import { cookies } from "next/headers" import { generators } from "openid-client" +import goConfig from "@/lib/config/config" import { getUniloginClient, uniloginClientConfig } from "@/lib/session/oauth/uniloginClient" import { getSession } from "@/lib/session/session" @@ -10,7 +11,7 @@ export async function GET() { const id_token = cookies().get("go-session:id_token")?.value // TODO: Is this where we want to redirect to if id token cannot be resolved? if (!id_token) { - return Response.redirect("/") + return Response.redirect(goConfig("app.url")) } const client = await getUniloginClient() const endSession = client.endSessionUrl({