diff --git a/app/sagas/deepLinking.js b/app/sagas/deepLinking.js index fac9e3292d..6da1e0bdcb 100644 --- a/app/sagas/deepLinking.js +++ b/app/sagas/deepLinking.js @@ -143,6 +143,21 @@ const handleOAuth = function* handleOAuth({ params }) { } }; +let consumedSamlToken; + +const handleSaml = function* handleSaml({ params }) { + const { credentialToken } = params; + if (!credentialToken || credentialToken === consumedSamlToken) { + return; + } + consumedSamlToken = credentialToken; + try { + yield loginOAuthOrSso({ saml: true, credentialToken }); + } catch (e) { + log(e); + } +}; + const handleShareExtension = function* handleOpen({ params }) { const server = UserPreferences.getString(CURRENT_SERVER); const user = UserPreferences.getString(`${TOKEN_KEY}-${server}`); @@ -175,6 +190,10 @@ const handleOpen = function* handleOpen({ params }) { yield handleOAuth({ params }); return; } + if (params.type === 'saml') { + yield handleSaml({ params }); + return; + } // If there's no host on the deep link params and the app is opened, just call appInit() let { host } = params;