Skip to content

Commit

Permalink
fix: Update stateRandom and reset cookies after a successful login (#494
Browse files Browse the repository at this point in the history
)
  • Loading branch information
machour authored and Houssein Djirdeh committed Oct 18, 2017
1 parent 9e883db commit b4e05a2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/auth/screens/login.screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import {
import { Button, Icon } from 'react-native-elements';
import AppIntro from 'rn-app-intro';
import queryString from 'query-string';
import CookieManager from 'react-native-cookies';

import { ViewContainer } from 'components';
import { colors, fonts, normalize } from 'config';
import { CLIENT_ID } from 'api';
import { auth } from 'auth';
import { translate } from 'utils';

const stateRandom = Math.random().toString();
let stateRandom = Math.random().toString();

const mapStateToProps = state => ({
locale: state.auth.locale,
Expand Down Expand Up @@ -214,7 +215,11 @@ class Login extends Component {
loaderText: translate('auth.login.preparingGitPoint', this.locale),
});

auth(code, state, navigation);
stateRandom = Math.random().toString();

CookieManager.clearAll().then(() => {
auth(code, state, navigation);
});
}
}
};
Expand Down

0 comments on commit b4e05a2

Please sign in to comment.