From ff0dfed2e8a1dd617af00c8062be75779fb67522 Mon Sep 17 00:00:00 2001 From: or-else Date: Mon, 7 Aug 2017 10:06:03 +0300 Subject: [PATCH] change auto-login order: try token first --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 4376907e..151c23a0 100644 --- a/index.html +++ b/index.html @@ -2384,14 +2384,14 @@ doLogin: function(login, password) { var instance = this; - // Try t login with token. If token is not available, try password. If no password, ask for it. + // Try to login with token. If token is not available, try password. If no password, ask for it. var promise = null; var token = Tinode.getLoginToken(); - if (password) { + if (token) { + promise = Tinode.loginToken(token.token); + } else if (password) { this.setState({password: null}); promise = Tinode.loginBasic(login, password); - } else if (token) { - promise = Tinode.loginToken(token.token); } else { this.setState({loginDisabled: false}); }