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
35 stars 21 forks source link

Update guest invite and guest confirmation flows #639

Closed erikguntner closed 3 months ago

erikguntner commented 6 months ago

Closes #405 Close #440

What changes did you make?

The following changes allow coordinators to invite guests to HUU by filling out a short form and sending an invitation link to the provided email. The guest can then accept the invite by clicking the provided link and confirm their account by creating a new password. This PR builds off the work that was done in #558 by handling some edge cases and writing tests. The changes include:

Rationale behind the changes?

After merging #558 I noticed there was still work needed in order to get the invite guest and guest confirmation user flows working properly. These changes allow both flows to be completed.

Testing done for these changes

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)

Visuals before changes are applied ![image](Paste_Your_Image_Link_Here_After_Attaching_Files)
Visuals after changes are applied https://github.com/hackforla/HomeUniteUs/assets/27253583/b4560da6-a1f5-48b3-9816-c5504a124644 Screenshot 2023-11-14 at 6 44 55 PM https://github.com/hackforla/HomeUniteUs/assets/27253583/049a6932-2d98-43c0-8f12-a366b4d26572
JpadillaCoding commented 5 months ago

Hey Erik, was there a way you could test the signup feature from the email on local?

erikguntner commented 4 months ago

@JpadillaCoding Are you trying to test out the flow on your machine? I think the only way you could test the sign up locally would be by sending an invite to an email you have access to.

JpadillaCoding commented 4 months ago

Gotcha, so while trying to test it out I get an error CustomMessage failed with error Cannot read properties of undefined (reading 'url'). I was wondering if this was maybe because it is being tested locally or not. Are you getting the same message? Also note that attempting to send it again after that error results in the error an account with the given email already exists. So it seems that It is going through on our end but not actually sending. This does also bring up a question: Do we want to make it so the invite can be sent an indefinite amount of times in the case of the email being deleted or not being received? Currently it seems that the only way to get another email sent is if the user is deleted from the database. Apart from that the modal works great being responsive and all the buttons work as intended.

erikguntner commented 4 months ago

@JpadillaCoding I just went through the sign up using an email flow and invite guest flow on my computer with no issues.

so while trying to test it out I get an error CustomMessage failed with error Cannot read properties of undefined (reading 'url')

This error may be because you are not passing a url in the request. This could be an issue with the .env not having a proper url, but I'm not sure. Happy to debug this during the meeting

Also note that attempting to send it again after that error results in the error an account with the given email already exists.

There is a way to resend an invite to an existing user by passing MessageAction='RESEND', to the boto3 client this just hasn't been implemented yet. I can't remember exactly what we decided as far as how we want to handle resends. I'll look through some of the issues and bring it up to PM if I can't find anything.