update api
This commit is contained in:
parent
ec95715177
commit
eeea527d03
@ -21,6 +21,7 @@ use Laravolt\Indonesia\Models\Province;
|
||||
use Laravolt\Indonesia\Models\Village;
|
||||
use Tymon\JWTAuth\Facades\JWTAuth;
|
||||
|
||||
|
||||
class LoginApiController extends Controller
|
||||
{
|
||||
/**
|
||||
@ -36,13 +37,14 @@ class LoginApiController extends Controller
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
$credentials = request(['email', 'password']);
|
||||
$credentials = request(['email', 'password']);
|
||||
|
||||
if (!($token = Auth::guard('api')->attempt($credentials))) {
|
||||
return response()->json(['error' => 'Unauthorized'], 401);
|
||||
}
|
||||
if (!($token = Auth::guard('api')->attempt($credentials))) {
|
||||
return response()->json(['error' => 'Unauthorized'], 401);
|
||||
}
|
||||
|
||||
return $this->respondWithToken($token);
|
||||
|
||||
return $this->respondWithToken($token);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user