wordist / wordist.xyz

Unblock words. Continue conversations.
MIT License
1 stars 5 forks source link

Hapi authentication #49

Open argonlaser opened 8 years ago

argonlaser commented 8 years ago

This issue is opened to do authenticate the user using JWT token. https://www.npmjs.com/package/hapi-auth-jwt2 would do the stuff I guess.

{
   "username" : "something",
   "password" : "somemorethings"
}

Status code 200

{
  "authorized" : false,
   "secretToken" : "jwt_token_value",
   "user" : {
      //  whole user object except password
   }
}

If auth is failure send back a 401 statuscode with body

{
  "authorized" : false
}
scriptnull commented 8 years ago

great work ! Was about to do this . we will go with the above module.

In future, if we decide to support third party sign on, we will add https://www.npmjs.com/package/bell.