Lexik JWT and API Platform : get current user? [closed]

I’m trying to learn how to create RESTful APis and modern(er) frontends, using Symfony with API Platform in back-end, and Vue with vue-router in front (so no routes configured in Symfony controllers).

I installed and configured Lexik JWT Bundle (with Gesdinet refresh bundle), set on HttpOnly Cookie, and it works: when I test a get request for something via api/docs, it refuses as expected if I don’t login first. Nice.

Now, I just want to get the connected user profile, so I need to make a (get) call to "api/users/{id}", according to the API Platform documentation.

How can I get the user ID from the token (stored in cookie) ?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *