0

Is there anyone who can help me do the sessions in angularjs? How to create an admin session and a user session according to the roles. In my database (mongodb) the table user contains the roles. As well as the pages following the sessions because a user must not see everything

  • Possible duplicate of [AngularJS- Login and Authentication in each route and controller](https://stackoverflow.com/questions/20969835/angularjs-login-and-authentication-in-each-route-and-controller) – Sunil Lama Nov 21 '17 at 03:31

1 Answers1

0

It is pretty easy with the use of ngStorage. All you need to do is reference the script file to ngStorage, include it in your main module and use it. You can make use of both sessionStorage as well as localStorage.

Sunil Lama
  • 4,531
  • 1
  • 18
  • 46
  • Thank you for your answer. I am a beginner in angularjs so I don't understand much what you mean exactly. In my project I use services remains from the backend and so I call them in front with the http. And in my case the roles are not in a separate table, but they are in a column of the user table. And I want to make sure that at the time of authentication when you are admin you can see all the pages but if you are a simple user you can not see the admin screens – Intissar Chouaieb Nov 19 '17 at 11:53
  • [role-based-access](https://stackoverflow.com/questions/20969835/angularjs-login-and-authentication-in-each-route-and-controller/20971528#20971528). Please refer to the answer given in this link – Sunil Lama Nov 21 '17 at 03:31