feat(onboarding): explicit role selection with role-aware steps#96
Merged
Conversation
BK1031
commented
Jun 25, 2026
Contributor
- Welcome step now asks current member / alumni / guest directly; the email-domain "Are you a current student?" dialog is removed
- Step list is derived from role: guests skip the academic step; alumni and guests get a new occupation step (job title + company)
- SAE registration number is shown only for current members
- Credentials step blocks member + non-ucsb.edu and alumni + ucsb.edu with role-anchored copy
- Past-graduation-year check is gated on role (member) instead of email domain
- Adds user.occupation_title / user.occupation_company columns (GORM AutoMigrate picks them up on boot)
- Backend now enforces the same role/email rules as the frontend, and gates the past-grad-year check on role
- Final username availability check in the consume handler narrows the race with concurrent signups before entity creation
- Trim mentor/sponsor from validInitialRoles + DiscordRolesForInitialRole (frontend no longer sends them; guest → other)
Replace the email-domain heuristic dialog with an explicit role picker (current member / alumni / guest) on the welcome step, and tailor the rest of the flow to the chosen role. Frontend: - Welcome step now gates progression on a chosen role. The "Are you a current student?" dialog is gone. - Step list is derived from the role: guests skip the academic step, alumni and guests get a new occupation step (job title + company) inserted before team gear. - SAE registration number is shown only for current members; the field is zeroed in the submit payload for other roles. - Credentials step blocks progression with a clearer dialog when member uses a non-ucsb.edu email, OR when alumni use a ucsb.edu email (those accounts expire after graduation). - Past-graduation-year check is gated on role === "member" instead of email domain. - Review step hides academic for guests and SAE for non-members, shows occupation for alumni/guests. Backend: - Add user.occupation_title and user.occupation_company columns (picked up by GORM AutoMigrate on next boot). - Forward the new fields through discord onboarding consume. - Match the frontend's role/email rules in the consume handler for defense in depth: reject member + non-ucsb.edu and alumni + ucsb.edu submissions, and gate the past-grad-year check on role. - Final username availability check before entity creation narrows the race with concurrent signups (DB unique index remains the authoritative guard, but losing the race after entity creation would orphan the entity). - Trim mentor/sponsor from validInitialRoles and DiscordRolesForInitialRole; the frontend no longer sends those values (guest → other).
…e-redesign # Conflicts: # discord/api/onboarding_token.go # discord/service/guild.go
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.