Revert "Fix login API"

This reverts commit 82c117d94b.
This commit is contained in:
Thomas Zilio 2018-05-15 20:02:34 +02:00
parent 697d4621da
commit 2cab589d83
2 changed files with 2 additions and 12 deletions

View File

@ -62,17 +62,7 @@ try {
break;
}
} catch (InvalidArgumentException $e) {
if (Auth::getInstance()->attempt(post('username'), post('password'))) {
$result = Auth::getInstance()->getToken();
}else{
$result = API::error('unauthorized');
// Se è in corso un brute-force, aggiunge il timeout
if (Auth::isBrute() && post('resource')=='login' ){
$result = Auth::getBruteTimeout();
}
}
} catch (Exception $e) {
$result = API::error('serverError');
}

View File

@ -3,7 +3,7 @@
switch ($resource) {
case 'login':
// Controllo sulle credenziali
if (Auth::getInstance()->attempt(post('username'), post('password'))) {
if (Auth::getInstance()->attempt($request['username'], $request['password'])) {
$token = Auth::getInstance()->getToken();
// Informazioni da restituire tramite l'API