Comments (4)
@FelipeOliveiraDvP the user id is already returned in the accessToken itself. Once you decode the accessToken, the sub
property holds the id.
from json-server-auth.
user
object added to register
and login
responses in 2.1.0 with 5af16c9
Thank you @manniniandrea for your PR :)
from json-server-auth.
@FelipeOliveiraDvP the profile resource is really good idea, you just use your token to get the full model, in 99% cases you will have to have this data to show it in your ui app.
@AmadoGuerrero yes, you are right, but first of all, you will have to install extra library to decode jwt & decode, this is extra unnecessary coding, it's not big deal but when you teach new people to do frontend, they have a lot of new stuff to learn, then simple i better
even better would be to return the user object with the token itself, so no more requests is required
thanks for your work, love it 💪
from json-server-auth.
I've created a pull request #43 to return user's accessory data, as you can read in the pull request itself, I thought it could be recklessly added without any additional parameters and without making it a breaking change.
from json-server-auth.
Related Issues (20)
- Error 400 Bad Request Question HOT 2
- How to change user password from client ? HOT 2
- Cannot find module express
- Can't create posts for logged-in users
- Able to get posts that belong to another user HOT 1
- npm installation does not work, looking for non existent path HOT 5
- How to logout? HOT 1
- Is there way to make admin account ?
- How Is This Different From jsonwebtoken? HOT 1
- "Incorrect password" HOT 2
- How to integrate with custom server.js file HOT 1
- Permission Error??
- Password Reset ?
- Cli command cannot find module 'express' HOT 7
- Is there a way to register user with field other than email?
- How to get list of items that belongs to logged user ?
- Override login response to render additional properties, like permissions
- Permissions not working
- It's will be better
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-server-auth.