angular / universal

Server-side rendering and Prerendering for Angular
MIT License
4.03k stars 482 forks source link

Angular universal & cookies based auth. #3212

Closed Avcajaraville closed 10 months ago

Avcajaraville commented 11 months ago

🚀 Feature request

What modules are relevant for this feature request?

Description

I am not quite sure about where to make this inquiry, but so far, I can't seem to find a way of handling cookies when using angular universal with cookies.

Prior versions, allowed me to hack my way, but that doesn't seem to be the case anymore.

It would be interesting to send cookies inside server requests when using universal.

The main use case is to be able to run angular applications, with a security layer and without the need for JS to be enabled. Think about performance or security.

Without JS on the client, this seems to be impossible at the moment.

Would love to get the advantages of cookies-based authentication and server-side rendering on protected routes. If there is no JS on the client, we can't use JWT or other mechanisms at the moment.

Describe the solution you'd like

I have no clue at all, not sure how this can be done.

osnoser1 commented 11 months ago

What problem do you have? I was able to implement this using A16+Universal

Muzummil commented 11 months ago

I used to implement packages like ngx-cookies, cookies-backend-service, etc. but there must be an angular provided way to handle these things instead of trial and test of third-party packages. By the way, the same packages didn't work with nest/ng-universal.

ayyash commented 11 months ago

I went through this before and fixed it multiple ways, see if this helps you: https://garage.sekrab.com/posts/authentication-in-angular-part-v-handling-ssr

alan-agius4 commented 10 months ago

Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular-ssr.

If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.

angular-automatic-lock-bot[bot] commented 9 months ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.