title: Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
body: <p>In my application,while registering the users i am saving username,password and jwt generated token with these fields in MONGO DB.When user tries to login with correct credentials then i will send the response with stored token.Then at client side(In my controller) i am using the localstorage to store the token so that i can send the same token for each and every request sent by the client.But I found some issues regarding this procedure:</p>
  
  <ol>
  <li>I am generating same token for one user every time.So if any third person is able to get the token then he can access the restricted page.</li>
  <li>Am i wasting space in db by storing the generated token in MONGODB</li>
  <li>Can Anyone access the token stored in localstorage other than the user.</li>
  <li>for each and every request in my single page application,I am again querying mongodb to get the token for that user and validating.Here,I am checking both client side and server side.</li>
  </ol>
  
  <p>I am using jwt to generate tokens,Node,Express,Mongoose in my application</p>
  
  <p>Am i following the good procedure.If not,can you please provide the solution for my approach or any new approach.
  I have searched many sites for token based authorization and session based authorization,But nothing worked for me.
  Note:I am beginner for Nodejs,AngularjS</p>