Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: Check token claim for CGU #179

Merged
merged 17 commits into from
Apr 5, 2022
Merged

Conversation

jonas-martinez
Copy link
Collaborator

@jonas-martinez jonas-martinez commented Mar 29, 2022

Closes #158

@jonas-martinez jonas-martinez added the enhancement New feature or request label Mar 29, 2022
@jonas-martinez jonas-martinez self-assigned this Mar 29, 2022
@jonas-martinez
Copy link
Collaborator Author

jonas-martinez commented Mar 29, 2022

@Nesqwik The current way I'm handling the cgu error is by creating a new error type in error_handler as :did_not_accept_cgu, this causes the error tuple to be {:did_not_accept_cgu, :did_not_accept_cgu} so this is not right.

Does this error correspond to :invalid_token ? If so, the error tuple would become {:invalid_token, :did_not_accept_cgu}

Copy link
Contributor

@pichoemr pichoemr left a comment

Choose a reason for hiding this comment

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

I thinking about how to test this change, if you have idea to make a unit test ?

apps/lenra/lib/lenra/guardian/guardian.ex Outdated Show resolved Hide resolved
apps/lenra/lib/lenra/services/cgu_services.ex Outdated Show resolved Hide resolved
apps/lenra_web/lib/lenra_web/guardian/token_helper.ex Outdated Show resolved Hide resolved
apps/lenra_web/lib/lenra_web/guardian/error_handler.ex Outdated Show resolved Hide resolved
apps/lenra/lib/lenra/guardian/guardian.ex Outdated Show resolved Hide resolved
Copy link
Member

@Nesqwik Nesqwik left a comment

Choose a reason for hiding this comment

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

i approved by mistake

@jonas-martinez jonas-martinez requested review from Nesqwik and pichoemr and removed request for Nesqwik March 29, 2022 15:05
@jonas-martinez jonas-martinez requested review from Nesqwik and removed request for pichoemr March 30, 2022 08:35
apps/lenra/lib/lenra/services/cgu_services.ex Outdated Show resolved Hide resolved
apps/lenra/lib/lenra/services/cgu_services.ex Outdated Show resolved Hide resolved
Copy link
Member

@Nesqwik Nesqwik left a comment

Choose a reason for hiding this comment

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

Very good solution :) Thx !

@pichoemr pichoemr merged commit dd004ec into beta Apr 5, 2022
@pichoemr pichoemr deleted the jonas-martinez/check-token-claim-cgu branch April 5, 2022 08:18
@shiipou
Copy link
Contributor

shiipou commented Apr 5, 2022

🎉 This PR is included in version 1.0.0-beta.43 🎉

The release is available on:

Your semantic-release bot 📦🚀

@shiipou
Copy link
Contributor

shiipou commented Apr 4, 2023

🎉 This PR is included in version 1.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@taorepoara
Copy link
Member

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check token claim for CGU
5 participants