Token based Authentication with Ream #35
Comments
I guess you mean custom server? If you're using express you can use express-jwt, no example for now. |
I am using express-jwt and express session to store token in a cookie. How can I set axios header, authorize routes and access token in vue components. Nuxt uses middle ware to set axios header like this
and then store token in store
|
@egoist An authentication/route authorization example with express-jwt and custom expressjs server would be very useful for developers new to Ream. |
@ansarizafar you cann follow this: https://github.com/auth0-blog/vue-jwt-authentication this will give you the idea but dont forget to use bcrypt to save the password on serverside they dont show this part |
I've already explained that to him, but he keeps asking: ream/ream#23 (comment) I'm guessing he hasn't gone through any tutorials yet. |
I am using Token based authentication in my projects from last 3 years. @cannap the tutorial you mentioned is about client side. If routes/pages are rendered on the server then you can't get token from localstorage as there is no localstorage available on the server. See how it can be done with Nuxt https://nuxtjs.org/examples/auth-routes |
Since you've been doing it for 3 years, how do you normally get the token to the server? Just add it to a header, or to the body, or in the query string when you make the request. |
@egoist Could you please suggest a solution, especially for those who don't understand how SSR works. |
I added a simple auth example: https://github.com/ream/ream/tree/master/examples/with-auth This does not include an API implementation but only a client workflow. Basically you only need to check if it's a valid user in entry file's |
How token based authentication can be implemented with Ream. Is there any example available?
The text was updated successfully, but these errors were encountered: