mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-06 12:04:11 +05:30
#48: do not choose account during oauth, when it is only one
This commit is contained in:
parent
fa070096c6
commit
d210231766
@ -14,7 +14,7 @@ export default class CompleteState extends AbstractState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enter(context) {
|
enter(context) {
|
||||||
const {auth = {}, user} = context.getState();
|
const {auth = {}, user, accounts} = context.getState();
|
||||||
|
|
||||||
if (user.isGuest) {
|
if (user.isGuest) {
|
||||||
context.setState(new LoginState());
|
context.setState(new LoginState());
|
||||||
@ -23,7 +23,7 @@ export default class CompleteState extends AbstractState {
|
|||||||
} else if (user.shouldAcceptRules) {
|
} else if (user.shouldAcceptRules) {
|
||||||
context.setState(new AcceptRulesState());
|
context.setState(new AcceptRulesState());
|
||||||
} else if (auth.oauth && auth.oauth.clientId) {
|
} else if (auth.oauth && auth.oauth.clientId) {
|
||||||
if (auth.isSwitcherEnabled) {
|
if (auth.isSwitcherEnabled && accounts.available.length > 1) {
|
||||||
context.setState(new ChooseAccountState());
|
context.setState(new ChooseAccountState());
|
||||||
} else if (auth.oauth.code) {
|
} else if (auth.oauth.code) {
|
||||||
context.setState(new FinishState());
|
context.setState(new FinishState());
|
||||||
|
Loading…
Reference in New Issue
Block a user