mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added IValidatable; moved validation to FormData
I still struggle to find out how to deal with arguments like $userNameOrEmail. Should I trim() them in controllers, or in service? If I do it in service, shouldn't all of such validation belong in there?
This commit is contained in:
@ -26,9 +26,9 @@ App.Auth = function(_, jQuery, util, api, appState, promise) {
|
||||
listTags: 'listTags',
|
||||
};
|
||||
|
||||
function loginFromCredentials(userName, password, remember) {
|
||||
function loginFromCredentials(userNameOrEmail, password, remember) {
|
||||
return promise.make(function(resolve, reject) {
|
||||
promise.wait(api.post('/login', {userName: userName, password: password}))
|
||||
promise.wait(api.post('/login', {userNameOrEmail: userNameOrEmail, password: password}))
|
||||
.then(function(response) {
|
||||
updateAppState(response);
|
||||
jQuery.cookie(
|
||||
|
Reference in New Issue
Block a user