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

Add custom census authorization handler #10

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

fblupi
Copy link
Member

@fblupi fblupi commented Jan 13, 2025

This authorization handler allows users to be directly verified with their birthdates by checking the records in a table.

You need to create records for the model Decidim::CustomCensusRecord. For example:

[
  { email: "[email protected]", date_of_birth: "1956-03-14" },
  { email: "[email protected]", date_of_birth: "1998-12-06" }
].each do |record|
  Decidim::CustomCensusRecord.create(email: record[:email], metadata: { date_of_birth: record[:date_of_birth] })
end

The verification will succeed if the user is in the census and introduces the same birthdate as the one in the database.

This authorization handler will allow us to work with the Decidim Kids module.

@fblupi fblupi requested a review from rxnetwalker January 13, 2025 15:49
@fblupi fblupi force-pushed the feat/custom-authorization-handler branch from 0787b04 to 03f55a2 Compare January 13, 2025 15:53
@fblupi fblupi force-pushed the feat/custom-authorization-handler branch from 03f55a2 to f8121dd Compare January 13, 2025 16:07
@fblupi fblupi merged commit 027fbd5 into feat/decidim_kids Jan 15, 2025
3 checks passed
@fblupi fblupi deleted the feat/custom-authorization-handler branch January 15, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants