Ресет стейта авторизации в том случае, если юзер захотел перейти на /

This commit is contained in:
SleepWalker 2016-03-16 07:03:23 +02:00
parent bd9635fc12
commit d19735b7e1
2 changed files with 6 additions and 1 deletions

View File

@ -74,6 +74,11 @@ export default class AuthFlow {
handleRequest(path, replace) {
this.replace = replace;
if (path === '/') {
// reset oauth data if user tried to navigate to index route
this.run('setOAuthRequest', {});
}
switch (path) {
case '/oauth':
this.setState(new OAuthState());

View File

@ -24,7 +24,7 @@ export default class CompleteState extends AbstractState {
context.setState(new ActivationState());
} else if (user.shouldChangePassword) {
context.setState(new ChangePasswordState());
} else if (auth.oauth) {
} else if (auth.oauth && auth.oauth.clientId) {
if (auth.oauth.code) {
context.setState(new FinishState());
} else {