File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -105,10 +105,11 @@ const AuthenticationWebView = () => {
105105 }
106106 if ( authType === 'saml' || authType === 'cas' ) {
107107 const parsedUrl = parse ( url , true ) ;
108- // ticket -> cas / validate & saml_idp_credentialToken -> saml
109- if ( parsedUrl . pathname ?. includes ( 'validate' ) || parsedUrl . query ?. ticket || parsedUrl . query ?. saml_idp_credentialToken ) {
110- let payload : ICredentials ;
111- if ( authType === 'saml' ) {
108+ // Only close the webview when redirected back to the Rocket.Chat server
109+ // This prevents premature closure when CAS delegates to another CAS server for MFA
110+ const isRocketChatServer = url . includes ( server ) ;
111+ // ticket -> cas / validate & saml_idp_credentialToken -> saml
112+ if ( isRocketChatServer && ( parsedUrl . pathname ?. includes ( 'validate' ) || parsedUrl . query ?. ticket || parsedUrl . query ?. saml_idp_credentialToken ) ) {
112113 const token = parsedUrl . query ?. saml_idp_credentialToken || ssoToken ;
113114 const credentialToken = { credentialToken : token } ;
114115 payload = { ...credentialToken , saml : true } ;
You can’t perform that action at this time.
0 commit comments