1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-17 03:51:06 +01:00

Revert "Fix login API"

This reverts commit 82c117d94b311d3adb14d1d6e6615a77a3e68e3c.
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; break;
} }
} catch (InvalidArgumentException $e) { } catch (InvalidArgumentException $e) {
if (Auth::getInstance()->attempt(post('username'), post('password'))) {
$result = Auth::getInstance()->getToken();
}else{
$result = API::error('unauthorized'); $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) { } catch (Exception $e) {
$result = API::error('serverError'); $result = API::error('serverError');
} }

View File

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