mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[fix] Better login handling
This commit is contained in:
parent
2cb0deca25
commit
2bed7f8cd0
1 changed files with 7 additions and 2 deletions
|
@ -201,8 +201,13 @@ app = Sammy('#main', function (sam) {
|
||||||
})
|
})
|
||||||
.fail(function(xhr) {
|
.fail(function(xhr) {
|
||||||
// console.log('fail');console.log(xhr);
|
// console.log('fail');console.log(xhr);
|
||||||
if (xhr.status == 401) {
|
if (xhr.status == 200) {
|
||||||
if (uri !== '/login') {
|
// Fail with 200, WTF
|
||||||
|
callback({});
|
||||||
|
} else if (xhr.status == 401) {
|
||||||
|
if (uri === '/login') {
|
||||||
|
c.flash('fail', y18n.t('wrong_password'));
|
||||||
|
} else {
|
||||||
c.flash('fail', y18n.t('unauthorized'));
|
c.flash('fail', y18n.t('unauthorized'));
|
||||||
c.redirect('#/login');
|
c.redirect('#/login');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue