Tuesday, 14 March 2017

My approach to authorization in Angular 2 and Node js - is it good?

I would like to ask you if my approach to authorization.

  1. Create an array of logged User objects on server site:

    {
      username: string
      token: string
    }
    
    
  2. After login success, token is being saved in Local Storage. Token must be unique.

  3. In every page, where access is restricted token would be send to server to check if such user is logged in. If yes - access will be granted.

What do you think about it?



via Michal Bialek

No comments:

Post a Comment