hackforla / HomeUniteUs

We're working with community non-profits who have a Host Home or empty bedrooms initiative to develop a workflow management tool to make the process scalable (across all providers), reduce institutional bias, and effectively capture data.
https://homeunite.us/
GNU General Public License v2.0
39 stars 21 forks source link

Auth invite and forgot password flow #808

Closed johnwroge closed 1 month ago

johnwroge commented 1 month ago

This is related to #789

What changes did you make?

Transferred '/auth/invite' , '/auth/confirmInvite', '/auth/new_password' endpoints and controllers from the old flask api to the new fast api. Updated the new controllers (invite, confirm_invite, new_password) to use pydantic request/response schemas. Added cookie schema for later which can be integrated into existing controllers dependent on team decision.

Rationale behind the changes?

Invite endpoint is needed to allow coordinators to invite new users to the application. Confirm invite endpoint is needed to allow new users to sign in through their email. New_password invite is needed to enable users to update their password.

Testing done for these changes

Integration tests will need to be implemented with Moto. I am having trouble testing the auth flow via the api docs in the browser because it is reliant on AWS Cognito and requires session tokens. I plan on looking at the Moto testing docs in the interim before bringing this up in the team meeting on Tuesday.

johnwroge commented 1 month ago

Thanks @paulespinosa