K
Kinde4w ago
Ricer

Authentication error

Hi, I have an Angular frontend and an Express backend app and use the ExpressJS SDK in my backend. The authentication process flow (angular hrefs to backend/login -> user enters credentials -> redirected back to redirect_url and then back to site URL) works fine. When working locally on my own machine, I use proxy.conf to send requests from my frontend to the backend and it works fine (I have a custom middleware that checks if user is authenticated using const isAuth = client.isAuthenticated()). When trying to work remotely (I have a development environment in AWS), the middleware fails (isAuth is false). Since I have no access to see which error cause this from the Typescript SDK's getToken() (I'm using the authentication code flow), I don't know how to debug this or why this is even happening.
2 Replies
Daniel_Kinde
Daniel_Kinde4w ago
HI @Ricer , can you see the cookies being used on the requests?
Ricer
RicerOP3w ago
Hey @Daniel_Kinde, I didn't check, but it was solved when I added { withCredentials: true } to the HTTP requests
Want results from more Discord servers?
Add your server