File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ function codeExchange(r) {
198198 r . variables . new_access_token = "" ;
199199 }
200200 r . headersOut [ "Set-Cookie" ] = "auth_token=" + r . variables . request_id + "; " + r . variables . oidc_cookie_flags ;
201- r . return ( 302 , r . variables . redirect_base + r . variables . cookie_auth_redir ) ;
201+ redirectPostLogin ( r ) ;
202202 }
203203 ) ;
204204 } catch ( e ) {
@@ -263,6 +263,15 @@ function validateIdToken(r) {
263263 }
264264}
265265
266+ // Redirect URI after successful login from the OP.
267+ function redirectPostLogin ( r ) {
268+ if ( r . variables . oidc_landing_page ) {
269+ r . return ( 302 , r . variables . oidc_landing_page ) ;
270+ } else {
271+ r . return ( 302 , r . variables . redirect_base + r . variables . cookie_auth_redir ) ;
272+ }
273+ }
274+
266275function logout ( r ) {
267276 r . log ( "OIDC logout for " + r . variables . cookie_auth_token ) ;
268277 r . variables . session_jwt = "-" ;
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ map $host $oidc_scopes {
4444 default "openid+profile+email+offline_access" ;
4545}
4646
47+ map $host $oidc_landing_page {
48+ # Where to send browser after successful login. If empty, redirects User
49+ # Agent to $request_uri.
50+ default "" ;
51+ #www.example.com $redirect_base;
52+ }
53+
4754map $host $oidc_logout_redirect {
4855 # Where to send browser after requesting /logout location. This can be
4956 # replaced with a custom logout page, or complete URL.
You can’t perform that action at this time.
0 commit comments