I am trying to find a way to get user specific data in an SPA from discourse.
The SPA has no own user management, i would like to use discourse for that (because we have no other user specific stuff that would need an own user management)
But i would like to show the currently logged in user of discourse at the SPA, as well as show a widget of the unread topics (which are user specific) for example, so i need to load data via API from discourse.
Things i tried:
- Use the Discourse SSO Path, which then redirects back to my SPA. Its fine, i get the current users email address, external id and so on - but nothing i could do the request with (token / key)
- Playing with cookie settings to be able to use the discourse cookie to make the request (no success)
- I have read about the user api key at User API keys specification, but i would feel weird for the user to allow an app, which is the same site, to access their discourse account.
Is there any possibility to achieve the behaviour i want?