deathandmayhem / jolly-roger

Dead men tell no tales!
MIT License
18 stars 5 forks source link

Support unauthenticated users in hunt invitation flow. #2101

Open jpd236 opened 2 months ago

jpd236 commented 2 months ago

Unauthenticated users who open a /join URL will see a welcome screen asking whether they are a new or existing user. New users are switched to the enrollment screen; existing users see the login screen as before.

The enrollment screen is updated to support brand new account creation, rather than just setting a password for an already-created account. If an invitation code is present, the user can enter an email, or elect to sign in with a Google account which can be used for future sign ins. As before, they can set initial profile fields as well. They will be added to the hunt once they are signed in (by virtue of being redirected to the original /join link from location state, but now as an authenticated user).

If a new user goes through the Google sign-in flow, the email and password fields are subsequently hidden and the credentials stashed until the user enters the remaining profile fields and completes enrollment.

Fixes #2047

jpd236 commented 2 months ago

This depends on https://github.com/deathandmayhem/jolly-roger/pull/2056 (which is included here). No need to review this until you're happy with that, but I figured I'd show where this is all eventually heading. Also happy to combine if you'd prefer.

ebroder commented 1 month ago

Left some comments. AccountForm.tsx is definitely...getting mildly out of hand in terms of complexity, although I don't think that's strictly your fault. I don't have concrete suggestions for improvement though. But overall, this seems like an OK direction to me.