Skip to content
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

feat: add accept invitation endpoint #355

Merged

Conversation

ojeytonwilliams
Copy link
Contributor

This is another followup PR (to #343) and only the last two commits are new.

Thanks to @Nirajn2311 for the suggestion to allow any authenticated user to tell the api that they've "accepted the invitation". I had considered extending the api/auth/auth0/callback endpoint, but this approach is nicer. It's less likely to break when the users-permissions plugin is updated and it keeps the logic separated.

Once this is in, we'll need to:

  • Disable registrations in general
  • Only allow Editors to create users (including setting the status to "new", for example)
  • Re-implement the users page, making use of the status to differentiate between active and invited users

We can probably filter out new users, since they'll only have that status after they've been created, but before they've been invited. i.e. a few milliseconds.

@sidemt I hijacked user.status for the invitation flow, but if this interferes with your plans for that, just let me know and I'll come up with another approach.

@ojeytonwilliams ojeytonwilliams requested a review from a team as a code owner November 22, 2023 19:07
Nirajn2311
Nirajn2311 previously approved these changes Nov 23, 2023
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
sidemt
sidemt previously approved these changes Nov 27, 2023
Copy link
Member

@sidemt sidemt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thank you for all the PRs for improving the invitation flow!

@sidemt sidemt merged commit 1e77380 into freeCodeCamp:main Nov 27, 2023
7 checks passed
@ojeytonwilliams ojeytonwilliams deleted the feat/add-accept-invitation-endpoint branch November 27, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants