Coder Social home page Coder Social logo

Comments (4)

AmadoGuerrero avatar AmadoGuerrero commented on May 22, 2024 3

@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.

jeremyben avatar jeremyben commented on May 22, 2024 1

user object added to register and login responses in 2.1.0 with 5af16c9

Thank you @manniniandrea for your PR :)

from json-server-auth.

myflowpl avatar myflowpl commented on May 22, 2024

@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.

manniniandrea avatar manniniandrea commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.