From 32d105051d63f1ce204001254640201de0497450 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Mon, 6 Apr 2020 16:15:13 -0300 Subject: [PATCH] [FIX] Saml (#1996) * [FIX] SAML incorrect close * [FIX] Pathname Co-authored-by: Diego Mello --- app/views/AuthenticationWebView.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/AuthenticationWebView.js b/app/views/AuthenticationWebView.js index b129d821..28de76a3 100644 --- a/app/views/AuthenticationWebView.js +++ b/app/views/AuthenticationWebView.js @@ -79,11 +79,11 @@ class AuthenticationWebView extends React.PureComponent { if (this.authType === 'saml' || this.authType === 'cas') { const { navigation } = this.props; const ssoToken = navigation.getParam('ssoToken'); - if (url.includes('ticket') || url.includes('validate') || url.includes('saml_idp_credentialToken')) { + const parsedUrl = parse(url, true); + if (parsedUrl.pathname?.includes('ticket') || parsedUrl.pathname?.includes('validate') || parsedUrl.query?.saml_idp_credentialToken) { let payload; if (this.authType === 'saml') { - const parsedUrl = parse(url, true); - const token = (parsedUrl.query && parsedUrl.query.saml_idp_credentialToken) || ssoToken; + const token = parsedUrl.query?.saml_idp_credentialToken || ssoToken; const credentialToken = { credentialToken: token }; payload = { ...credentialToken, saml: true }; } else {