Skip to content

Commit

Permalink
Trying to use nextresponse for redirecting
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceo committed Nov 18, 2024
1 parent c0cca47 commit 049296c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/auth/callback/unilogin/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NextRequest } from "next/server"
import { NextRequest, NextResponse } from "next/server"
import * as client from "openid-client"

import goConfig from "@/lib/config/config"
Expand Down Expand Up @@ -108,10 +108,10 @@ export async function GET(request: NextRequest) {
// eslint-disable-next-line no-console
console.log("Debug line 109")

return Response.redirect(`${goConfig("app.url")}/user/profile`)
return NextResponse.redirect(`${goConfig("app.url")}/user/profile`)
} catch (error) {
console.error(error)
// TODO: Error page or redirect to login page.
return Response.redirect(goConfig("app.url"))
return NextResponse.redirect(goConfig("app.url"))
}
}

0 comments on commit 049296c

Please sign in to comment.