Add invitation codes to the hunt schema. Codes are randomly generated IDs.
Allow admins and hunt operators to (re)generate and clear invitation links from the hunt profile list page.
Allow any user with invitation permissions to see the current invitation link (if any) from the hunt profile list page.
Add an authenticated /join/:invitationCode endpoint which adds the current user to the hunt with that code and redirects to that hunt page. (If a user is unauthenticated when they open this link, they will be redirected here after signing in.)
To be considered for this PR:
[x] ~~I believe users can access invitation IDs from the raw hunt data, even if not made visible, since they are part
of the hunt schema and are not filtered from the client. Is this resolvable without a broader change?~~ Resolved by separating invitations out of hunts and into their own model
[ ] UX polish. Possible ideas include:
[x] Confirmation dialog when generating/regenerating/clearing invitation links
[ ] Confirmation message upon successfully joining via an invitation link
[ ] Better UI for the invitation code
[ ] Unit tests
To be handled in a future PR:
When an unauthenticated user opens an invitation link and is redirected to /login, provide the option to
create an account. This can be detected by checking the history state since it is stored on redirect. If the invitation link is verified upon form submission, create the new user and add it to the hunt.
To be considered for this PR:
To be handled in a future PR:
See #2047