Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Issue with refresh token in Laravel 5.1 / AngularJS app

$
0
0

@sukhsingh wrote:

I am having issue with refreshing a JWT Token in my Ionic / Angularj JS app. The restful api when tested in postman successfully returns a refreshed token and I can use it in postman to make other rest calls. However, when I try storing the refreshed token on my localStorage by over riding the existing token.

I have looked at laravel / angularjs JWT token refresh for clues but the issue I have is not with Laravel generating the token. It is the Ionic / Angular.js not being able to store the refreshed token. Can someone please advise?

// Laravel token refresh call
public function myToken()
{
$token = JWTAuth::getToken();
$refreshtoken = JWTAuth::refresh($token);
$token = $refreshtoken;
return response()->json(compact('token'));
}

// Angular.JS token call
if($localStorage.hasOwnProperty("token") === true) {
var mytoken = $localStorage.token;
}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>