hello! im developing lemmy client (on html5). i tried to do login function but… when i try to fetch /v3/user backend with auth-token it give me error:

{
  "error": "no_id_given"
}

but why? what im doing wrong? if you want here is my source file on github ( function: getLoggined() )

  • flamingos-cant
    link
    fedilink
    English
    16 days ago

    /api/v3/user is for fetching info about any user, it requires either a person_id or username to be given as a URL param to work, e.g. https://feddit.uk/api/v3/user?person_id=28426 will get my profile. There currently isn’t a way to get just the person_view from the JWT, though API v4 will have an /account endpoint that you’ll be able to GET with the auth header. Most apps GET the /site endpoint and use my_user returned from that.