[FIX] Saml (#1996)

* [FIX] SAML incorrect close

* [FIX] Pathname

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-04-06 16:15:13 -03:00 committed by GitHub
parent 0298c38b3d
commit 32d105051d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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 {