client/auth: keep cookie after auto auth failures
...remove it on any login attempt.
This commit is contained in:
parent
2578a297bf
commit
7f4708c696
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,6 @@ class AuthController {
|
||||||
const auth = cookies.getJSON('auth');
|
const auth = cookies.getJSON('auth');
|
||||||
if (auth && auth.user && auth.password) {
|
if (auth && auth.user && auth.password) {
|
||||||
api.login(auth.user, auth.password).catch(errorMessage => {
|
api.login(auth.user, auth.password).catch(errorMessage => {
|
||||||
cookies.remove('auth');
|
|
||||||
page('/');
|
page('/');
|
||||||
this.loginView.notifyError(
|
this.loginView.notifyError(
|
||||||
'An error happened while trying to log you in: ' +
|
'An error happened while trying to log you in: ' +
|
||||||
|
@ -27,6 +26,7 @@ class AuthController {
|
||||||
this.loginView.render({
|
this.loginView.render({
|
||||||
login: (name, password, doRemember) => {
|
login: (name, password, doRemember) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
cookies.remove('auth');
|
||||||
api.login(name, password)
|
api.login(name, password)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const options = {};
|
const options = {};
|
||||||
|
|
Loading…
Reference in a new issue