Merge branch 'oktaaa' of https://git.abbauf.com/MAGANG_TB_dan_PNP_2023/Aplikasi_Rekber
This commit is contained in:
		
						commit
						181f1cc236
					
				@ -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