Fix SAML login with OneLogin (#359)
This commit is contained in:
parent
07af08b74a
commit
0812507b9e
1 changed files with 10 additions and 6 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
} from 'react-native';
|
||||
|
||||
import CookieManager from 'react-native-cookies';
|
||||
import Client from 'mattermost-redux/client';
|
||||
|
||||
export default class Saml extends PureComponent {
|
||||
static propTypes = {
|
||||
|
|
@ -27,16 +28,19 @@ export default class Saml extends PureComponent {
|
|||
|
||||
onNavigationStateChange = (navState) => {
|
||||
const {url} = navState;
|
||||
if (url.includes('/login/sso/saml') && url.includes('mobile')) {
|
||||
|
||||
if (url.includes('/login/sso/saml')) {
|
||||
CookieManager.get(this.props.serverUrl, (err, res) => {
|
||||
const token = res.MMAUTHTOKEN;
|
||||
const {
|
||||
handleSuccessfulLogin,
|
||||
setStoreFromLocalData,
|
||||
goToLoadTeam
|
||||
} = this.props.actions;
|
||||
|
||||
if (token) {
|
||||
const {
|
||||
handleSuccessfulLogin,
|
||||
setStoreFromLocalData,
|
||||
goToLoadTeam
|
||||
} = this.props.actions;
|
||||
|
||||
Client.setToken(token);
|
||||
handleSuccessfulLogin().
|
||||
then(setStoreFromLocalData.bind(null, {url: this.props.serverUrl, token})).
|
||||
then(goToLoadTeam);
|
||||
|
|
|
|||
Loading…
Reference in a new issue