Skip to content

Commit

Permalink
fix oidc redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
moeakwak committed Apr 6, 2024
1 parent 41c1a4b commit 39c6b9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/api/oidc/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { writeUserLoginEventLog } from "@/server/actions/write-event-log";
import { eq } from "drizzle-orm";
import { users } from "@/server/db/schema";
import { UserCreateSchema, UserRoles } from "@/schema/user.schema";
import { redirect } from "next/navigation";

const OIDCUserInfoSchema = z.object({
sub: z.string(),
Expand Down Expand Up @@ -94,7 +95,7 @@ export async function GET(request: NextRequest) {
const sessionCookie = lucia.createSessionCookie(session.id);
cookies().set(sessionCookie);

return NextResponse.redirect(new URL("/", request.url));
redirect("/");
} catch (error) {
console.error("Error in OIDC callback:", error);
if (error instanceof OAuth2RequestError) {
Expand Down

0 comments on commit 39c6b9c

Please sign in to comment.