Merged
Conversation
Closed
3149f10 to
e37ef0b
Compare
e37ef0b to
d552c33
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a full invitation system for user registration, allowing admins to invite users via email with a secure, time-limited token. It includes new database models and migrations, changes to registration logic, UI updates, and email functionality. The most important changes are grouped below:
Invitation System Backend:
create-invite-tokens.js) and model (invite-token.js) for storing invite tokens, including token generation, validation, usage marking, and cleanup methods. [1] [2]register.jsto support invite tokens: validates tokens, pre-fills the invited email, auto-activates invited users, and marks tokens as used after registration. [1] [2]Admin User Invitation Flow:
users.jsfor inviting users via email, including form display and sending invitation emails, with checks for SMTP setup and duplicate emails. [1] [2]sendInviteEmailfunction inemail.jsto generate and send styled invitation emails with registration links and token expiration info.User Interface Updates:
register.ejs) to show an invite banner, pre-fill and lock the email field for invited users, and preserve invite tokens through redirects. [1] [2] [3]users/invite.ejs) for admins. [1] [2]These changes collectively enable a secure, admin-driven invitation workflow for user onboarding.