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

User Onboarding #1058

Merged
merged 7 commits into from
Dec 4, 2024
Merged

User Onboarding #1058

merged 7 commits into from
Dec 4, 2024

Conversation

7dev7urandom
Copy link

  • Create a page for organization admins to invite new members
  • Modify db table OrganizationMembershipInvites to include roles and groups to assign to the new member
  • Rework authentication flow to allow users to login only if they are a member of an organization or they are currently joining one, and handle revoking sessions for users who no longer exist
  • Create a flow for organization membership invites to be accepted and a corresponding page (see notes below)
  • Many miscellaneous bug fixes

The flow is handled as follows (which is slightly different than described to @chrisvire originally):

  1. To login, a user must either
    a. exist in the database and be a member of an organization -> standard login
    b. have a valid invite token as a cookie -> redirected to invite acceptance page
  2. To accept an invite:
    a. The user goes to the page /invitations/organization-membership?t=INVITE-TOKEN-UUID-V4
    b. If they are logged in already (they are already a user on the site and a member of some other organization) they are immediately added, otherwise:
    c. The invite token is saved as a browser cookie and the user is redirected to the login page
    d. The user logs in and is redirected back to the invitation page, where the cookie is cleared and the user creation (if applicable) and organization membership are created, along with corresponding groups and roles

Note: schema.prisma is modified by this PR. Don't forget to apply the migration.

Handle old user logins
Many bug fixes
Cleanup and refactor code
@7dev7urandom 7dev7urandom force-pushed the feature/user-onboarding branch from 07ba106 to 4a5b01d Compare December 3, 2024 04:36
Copy link

@FyreByrd FyreByrd left a comment

Choose a reason for hiding this comment

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

Looks good overall. Just a few things that I would change before merging.

  1. The database we are using has support for array field types. I would recommend using that instead of a CSV string of numbers for the database changes, unless you think it would be too much of a performance cost.
  2. It would be nice to have screenshots of the UI changes. I would look at the UI myself, but I don't want to lose the data I have locally from testing product builds.
  3. This does not need to be in this PR, but this PR could still potentially be a good place to handle locked users (see my TODO note in /users/+page.server.ts).

Copy link

@FyreByrd FyreByrd left a comment

Choose a reason for hiding this comment

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

The migration script does not reflect the update from string to int array in the schema. You will want to fix this before merging.

@FyreByrd
Copy link

FyreByrd commented Dec 4, 2024

Screenshots:

Invite User button:
image

Invite User page:
image

Locked User page:
image

No Organization page:
image

@chrisvire
Copy link
Member

@7dev7urandom The section for assigned groups, it needs to be able to handle lots of groups with long titles. Here is the list for Kalaam (who would most likely use this feature:

"IPS Bangladesh"
"IPS GospelME"
"IPS Breath of Life (نسمة الحياة)"
"IPS"
"IPS Al Kalima"
"IPS Burkina Faso"
"IPS Cameroon"
"IPS Dictionary Apps"
"IPS Eurasia"
"IPS Indonesia"
"IPS East Africa"
"IPS Mali"
"IPS Niger"
"IPS RDC"
"IPS Senegal"
"ROCK International"
"IPS South Sudan"
"IPS Republic of Congo"
"OSA/PWA Only"
"IPS Côte d'Ivoire"
"IPS Chad"
"IPS Demo"
"Alkitab Maluku (inherited store)"
"IPS Chad LIterature (non-Bible related)"
"IPS FDPM Colombia"
"Pahari Masihi Sahtiya Sansthan (inherited store)"
"Nepal Matribhasha (NMB) (inherited store)"
"IPS Injiil4all (Sensitive apps - use only when asked)"
"Ethiopia (inherited store)"
"Dar al-Kitab al-Sharif (The House of Wisdom - Arabic apps)"
"Love Fellowship (inherited Store)"
" Оби Ҳаёт - Water of Life"
"CIC App Man - SIL India (inherited store- Mark Penny) "
"IPS Kmedia"
"IPS Joy of Christ [بهجة المسيح]"
"Dictionary App Man (inherited store - Mark Penny)"
"SIL Nepal (inherited store)"
"IPS Academy Ihsan (formally Payghamaf)"
"Alkitab Nuaulu (inherited store-Rosemary Bolton)"
"Kimaragang (inherited store)"
"Bible for Children (Greg Stetski)"
"IPS New Tibetan Bible"
"IPS CBT India (Carey Bible Trans. (NLCI))"
"IPS Nigeria"
"IPS Togo"
"Alkitab Tehit (inherited-Erin Hesse)"
"IPS EBT Bible Apps"
"IPS Madagascar"
"EBT Bible Apps"
"IPS Guinea-Bissau"
"Asawan Apps (Hannah Fielder - hesfielder@gmail.com)"

@7dev7urandom
Copy link
Author

Those group names will fit fine.
image

Remove unnecessary components from project view
@7dev7urandom 7dev7urandom merged commit f98820d into feature/svelte Dec 4, 2024
2 checks passed
@7dev7urandom 7dev7urandom deleted the feature/user-onboarding branch December 4, 2024 16:43
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