Skip to content

Commit

Permalink
feat: add redirectURLBase to options
Browse files Browse the repository at this point in the history
  • Loading branch information
peterphanouvong committed May 15, 2024
1 parent c3b43bd commit 817d1b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/authMiddleware/authMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const handleMiddleware = async (req, options, onSuccess) => {

if (!kindeToken) {
const response = NextResponse.redirect(
new URL(loginRedirectUrl, config.redirectURL)
new URL(loginRedirectUrl, options.redirectURLBase || config.redirectURL)
);
return response;
}
Expand Down Expand Up @@ -84,7 +84,9 @@ const handleMiddleware = async (req, options, onSuccess) => {
return;
}

return NextResponse.redirect(new URL(loginRedirectUrl, config.redirectURL));
return NextResponse.redirect(
new URL(loginRedirectUrl, options.redirectURLBase || config.redirectURL)
);
};

/**
Expand Down

0 comments on commit 817d1b3

Please sign in to comment.