Quando un utente accede al mio sito, ottengo il JWT e lo faccio accedere a Discourse immediatamente. Alla fine di questo flusso, però, l’utente finisce sul sito di Discourse invece di tornare al mio.
Ho provato a consultare i metodi di reindirizzamento della libreria omniauth, che includono il parametro origin e il cookie destination_urlda qui, ma nessuno di questi sembra funzionare.
EDIT: Mi sono appena reso conto di aver guardato due librerie diverse: omniauth e i callback omniauth di Discourse. Comunque, sono ancora incerto su come far funzionare tutto ciò.
I don’t think this is a supported path. In general, a user would be on discourse, click login, visit your site for auth and be redirected back. If a user logs in directly on your site, they should stay on your site.
Typically how we do this is keep Discourse logged out, but when they click “Login” it’ll redirect back without having to fill out the authentication form again.
So, the embeds do make use of the auth session (or the session cookie) to show or hide private discourse topics.
This auth flow does make sense, but for starters, I’m going to redirect people to the discourse forum for login on a new tab. They will be able to access private topics after a refresh.