From d2102317669be9c82cba934b6b167318f82bc96c Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Sat, 19 Nov 2016 14:43:50 +0200 Subject: [PATCH] #48: do not choose account during oauth, when it is only one --- src/services/authFlow/CompleteState.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/authFlow/CompleteState.js b/src/services/authFlow/CompleteState.js index bb4bc7d..49b55bf 100644 --- a/src/services/authFlow/CompleteState.js +++ b/src/services/authFlow/CompleteState.js @@ -14,7 +14,7 @@ export default class CompleteState extends AbstractState { } enter(context) { - const {auth = {}, user} = context.getState(); + const {auth = {}, user, accounts} = context.getState(); if (user.isGuest) { context.setState(new LoginState()); @@ -23,7 +23,7 @@ export default class CompleteState extends AbstractState { } else if (user.shouldAcceptRules) { context.setState(new AcceptRulesState()); } else if (auth.oauth && auth.oauth.clientId) { - if (auth.isSwitcherEnabled) { + if (auth.isSwitcherEnabled && accounts.available.length > 1) { context.setState(new ChooseAccountState()); } else if (auth.oauth.code) { context.setState(new FinishState());