Web tokens in Angular 2+

后端 未结 3 767
天涯浪人
天涯浪人 2020-12-11 11:02

I am sending a POST request to a back end REST API, via a login component. I get an x-auth token back in the response headers. How do I get and store this token so I can use

3条回答
  •  囚心锁ツ
    2020-12-11 11:48

    Using NgCookie module you may set like:

      $cookies.put("token","your_response_val");
    

    After that for further use.... $cookies.get ()

提交回复
热议问题