(Question) Bearer authentication with Angular SSR not working #392

Closed
opened 2025-08-09 17:16:07 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @FreedCapybara on 10/2/2017

I've implemented the basic ideas from this issue, but somehow I always get Microsoft.AspNetCore.NodeServices:Error: Unhandled Promise rejection: Converting circular structure to JSON when trying to hit any endpoint with an [Authorize] attribute during SSR.

My app uses JWT authentication with the token stored in a cookie so I can access it on the server. I know the authorization header is getting set correctly on the server during SSR because I can console.log the token and see it in the server output. I tried enabling CORS in case the Node stuff is running on a separate port, but that hasn't made a difference. The exact same request code works perfectly when run on the client.

What am I missing?

Thanks in advance!

*Originally created by @FreedCapybara on 10/2/2017* I've implemented the basic ideas from [this issue](https://github.com/angular/universal-starter/issues/373), but somehow I always get `Microsoft.AspNetCore.NodeServices:Error: Unhandled Promise rejection: Converting circular structure to JSON` when trying to hit any endpoint with an `[Authorize]` attribute during SSR. My app uses JWT authentication with the token stored in a cookie so I can access it on the server. I know the authorization header is getting set correctly on the server during SSR because I can `console.log` the token and see it in the server output. I tried enabling CORS in case the Node stuff is running on a separate port, but that hasn't made a difference. The exact same request code works perfectly when run on the client. What am I missing? Thanks in advance!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#392
No description provided.