-
Notifications
You must be signed in to change notification settings - Fork 59
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
Save login number to constituent table #705
Comments
7 tasks
Alex-is-Gonzalez
added a commit
that referenced
this issue
Dec 11, 2023
Added phone number to the constituent table. Only Step 1 and 2 completed on issue #705
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Goal: collect number from Auth0 login process and save into constituent table so we have the ability to send notifications later on
Background info
Constituent table lives within: amplify/server/db/migrations/20220413154827_rename-volunteers-table-to-constituents.js
Data types:
Directions
To save the user's phone number from Auth0 Universal Login to the constituent table, you can modify the up function of the migration file that creates the constituent table. Here are the steps you can follow:
This code gets the phone number from the req.user._json object, which is provided by Passport when the user is authenticated. It then checks if the user already exists in the constituent table based on their email address. If the user exists, it updates their phone number. If the user does not exist, it creates a new constituent with the name, email, and phone number.
The text was updated successfully, but these errors were encountered: