Return plain text token as a JSON response after successful login

pull/3/head
Hasin Hayder 3 years ago
parent 6a93774315
commit 4023cc049e

@ -92,7 +92,8 @@ class UserController extends Controller {
$_roles[] = $role->slug;
}
return $user->createToken('hydra-api-token', $_roles)->plainTextToken;
$plainTextToken = $user->createToken('hydra-api-token', $_roles)->plainTextToken;
return response(['error' => 0, 'token' => $plainTextToken], 200);
}
/**

Loading…
Cancel
Save