angularjsangular-cookies

how can i check my token on very request


Here im using angularjs with webApi when i login with my credentials its generating Token as

data:
access_token:"SKvWJ2-IK_Zohn6xLS6HXydoV1NdovM5wvtcTvJM0hkZ"
expires_in:86399
token_type:"bearer"

This Token is stored in

 LoginFac.LoginWithToken(obj).then(function (d) {
            sessionStorage.employee = angular.toJson(d);

I stored my authentication Details in sessionStorage.employee when i need my access_token And token_type how can i get it back


Solution

  • You can use sessionStorage.getItem and JSON.parse and then access the property access_token