1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Fix login API

This commit is contained in:
Luca
2018-05-15 15:15:24 +02:00
parent c8a6f2d4d2
commit 82c117d94b
2 changed files with 9 additions and 2 deletions

View File

@@ -62,7 +62,14 @@ try {
break;
}
} catch (InvalidArgumentException $e) {
$result = API::error('unauthorized');
if (Auth::getInstance()->attempt(post('username'), post('password'))) {
$token = Auth::getInstance()->getToken();
$result = $token;
}else{
$result = API::error('unauthorized');
}
} catch (Exception $e) {
$result = API::error('serverError');
}