Currently, I have this code.
/**
* Refresh a token.
*
* @param $token
* @return \Illuminate\Http\JsonResponse
*/
public function token($token)
{
if(!$token)
{
throw new BadRequestHttpException('Geen token aangeleverd');
}
try {
$newToken = \JWTAuth::refresh($token);
} catch(TokenInvalidException $e) {
throw new AccessDeniedHttpException('Incorrect token');
}
return \Response::json(compact('newToken'));
}
When I send a valid token to this method, I receive an extremely long token back from the JWTAuth::refresh
call. It looks like the new token is appended to my existing token.
I'm not too sure what I am doing wrong, so please fire at will. ;)
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1QTluoR
via IFTTT
Aucun commentaire:
Enregistrer un commentaire