1

I need help with piece of code.

Check the presence of a browser cookie If the cookie is not present, re-direct to a specific URL (stay on the page/do nothing if the cookie is there).

I assume it can be easily handled by Angular.

I would appreciate the help, Many thanks!

Sayan
  • 481
  • 5
  • 12
  • I think you are referring to the jwt-auth service, which you can use the ngx-cookie CookieService in. Please provide what you have done so far. – Patrik Alexits Mar 26 '19 at 09:23
  • Pratik, I'm not using any npm to handle cookie. In my project using basic Auth, so when the user successfully login getting three cookies from BE(nsm-role, token, TWISTED_SESSION). This cookie information set on Response-headers in next each API call. Now my current requirement is if explicitly cookie removed(here is a method to remove all present cookie in FE side - https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript )from FE side the page should redirect to login page. – Sayan Mar 26 '19 at 09:57

0 Answers0