Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add secure cookie based auth #781

Merged
merged 1 commit into from
Sep 8, 2024
Merged

feat: add secure cookie based auth #781

merged 1 commit into from
Sep 8, 2024

Conversation

berenteb
Copy link
Contributor

@berenteb berenteb commented Sep 8, 2024

With this PR approved, the backend will start to set cookies for the domain from the site url, making cookies HTTP only and Secure, removing the need to manually get the JWT from the query param and state manage from there.
I made sure to handle the refresh mechanism for Create & Edit team flows as well as form submission.
Logout works as well by setting the cookie to null.

@berenteb berenteb requested review from Gerviba and Isti01 September 8, 2024 14:23
Copy link

vercel bot commented Sep 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmsch-g7 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2024 2:23pm
cmsch-golyabal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2024 2:23pm
cmsch-gtb ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2024 2:23pm
cmsch-qpa ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2024 2:23pm
cmsch-testing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2024 2:23pm
10 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cmsch-cst ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-felezo ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-golyakonf ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-golyakorte ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-karacsony ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-kozelokepzes ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-schnyari ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-seniortabor ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-snyt ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm
cmsch-tanfolyam ⬜️ Ignored (Inspect) Sep 8, 2024 2:23pm

@@ -28,6 +28,7 @@ class WebMvcConfig(
arrayOf("/api/**", "/manifest/**", "/cdn/**").forEach {
registry.addMapping(it)
.allowedOrigins(productionUrl)
.allowCredentials(true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are public endpoints, but it shouldn't hurt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but the request fill fail if there are credentials provided

@berenteb berenteb merged commit ceaa47a into staging Sep 8, 2024
16 checks passed
@Isti01 Isti01 deleted the jwt-cookie-auth branch October 3, 2024 14:55
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants