File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ function codeExchange(r) {
198
198
r . variables . new_access_token = "" ;
199
199
}
200
200
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 ) ;
202
202
}
203
203
) ;
204
204
} catch ( e ) {
@@ -263,6 +263,15 @@ function validateIdToken(r) {
263
263
}
264
264
}
265
265
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
+
266
275
function logout ( r ) {
267
276
r . log ( "OIDC logout for " + r . variables . cookie_auth_token ) ;
268
277
r . variables . session_jwt = "-" ;
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ map $host $oidc_scopes {
44
44
default "openid+profile+email+offline_access" ;
45
45
}
46
46
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
+
47
54
map $host $oidc_logout_redirect {
48
55
# Where to send browser after requesting /logout location. This can be
49
56
# replaced with a custom logout page, or complete URL.
You can’t perform that action at this time.
0 commit comments