Skip to content

Commit

Permalink
Don't let auth redirects set redirectUri
Browse files Browse the repository at this point in the history
  • Loading branch information
youngkidwarrior committed Jul 19, 2024
1 parent 00dbe0b commit 3887845
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/next/utils/userProtected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ export function userProtectedGetSSP<

if (!session) {
log('no session')
const destination = ctx.req.url
? `/auth/sign-in?redirectUri=${encodeURIComponent(ctx.req.url)}`
: '/auth/sign-in'
const destination =
ctx.req.url === undefined || ctx.req.url.includes('/auth')
? '/auth/sign-in'
: `/auth/sign-in?redirectUri=${encodeURIComponent(ctx.req.url)}`

return {
redirect: {
destination,
Expand Down

0 comments on commit 3887845

Please sign in to comment.