Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions app/sagas/deepLinking.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down Expand Up @@ -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;
Expand Down
Loading