After getting a LoginResponse from the Lemmy API, it returns an auth JWT token.
I'm trying to figure out how I can get that users person_id or username so I can make a GetPersonDetails request for the currently logged in user.
Any ideas on how to do this?
5 Comments
picoblaanket@lemmy.ml · 2 pts · 3y
Successful Login automatically initiates a GetSite operation, which contains person_id:
and username:
Maybe that will do it.
Slated@vlemmy.net · 2 pts · 3y
You’ll want to save the JWT and then use it as the auth parameter for GetPersonDetails
fishcharlie@eventfrontier.com · 0 pts · 3y
This doesn't work either. Only passing in an
authparameter into GetPersonDetails is not valid and returns an error.Slated@vlemmy.net · 1 pts · 3y
Oh strange I would assume you would want to either include the id or the username, whatever the documentation asks for. You can also always just use the GetSite endpoint and GetSiteResponse.my_user
plisken@lemmy.fmhy.ml · -1 pts · 3y
I havent tried, but usually a JWT contains some sort of user ID