File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
deps/rabbitmq_management/priv/www/js Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ function start_app_login () {
167167 } ) ;
168168 }
169169 } )
170- // TODO REFACTOR: this code can be simplified
170+
171171 if ( oauth . enabled ) {
172172 if ( has_auth_credentials ( ) ) {
173173 check_login ( ) ;
Original file line number Diff line number Diff line change @@ -243,11 +243,23 @@ function oauth_completeLogin() {
243243
244244function oauth_initiateLogout ( ) {
245245 if ( oauth . sp_initiated ) {
246- mgr . signoutRedirect ( )
246+ mgr . metadataService . getEndSessionEndpoint ( ) . then ( endpoint => {
247+ if ( endpoint == undefined ) {
248+ // Logout only from management UI
249+ mgr . removeUser ( ) . then ( res => {
250+ clear_auth ( )
251+ oauth_redirectToLogin ( )
252+ } )
253+ } else {
254+ // OpenId Connect RP-Initiated Logout
255+ mgr . signoutRedirect ( )
256+ }
257+ } )
247258 } else {
248259 go_to_authority ( )
249260 }
250261}
262+
251263function oauth_completeLogout ( ) {
252264 clear_auth ( )
253265 mgr . signoutRedirectCallback ( ) . then ( _ => oauth_redirectToLogin ( ) )
@@ -265,8 +277,5 @@ function validate_openid_configuration(payload) {
265277 if ( typeof payload . jwks_uri != 'string' ) {
266278 throw new Error ( "Missing jwks_uri" )
267279 }
268- if ( typeof payload . end_session_endpoint != 'string' ) {
269- throw new Error ( "Missing end_session_endpoint" )
270- }
271280
272281}
You can’t perform that action at this time.
0 commit comments