fides icon indicating copy to clipboard operation
fides copied to clipboard

Invite users via email

Open galvana opened this issue 1 year ago • 3 comments

Closes https://ethyca.atlassian.net/browse/PROD-1553

Description Of Changes

Invite users by email!

Initial design doc here: https://ethyca.atlassian.net/wiki/spaces/EN/pages/2872344650/Hackathon+2023+-+Team+1

Code Changes

Frontend

  • [x] Adds email field to user creation/edit flow
  • [x] Conditionally render setting up a different user's password—only go through this flow if email messaging is not enabled. Otherwise rely on emailing the user to have them set up their own password and activate their own account
  • [x] User page and overall user table now have fields for email as well as a badge for if invite is pending
  • [x] Refactor login page to use our more standard components (this lets us toggle to see the password!)
  • [x] Render a login page with different copy if visiting the url with an invite code- the username field is disabled and prefilled
  • [x] Call new accept invite endpoint when "logging in"
  • [x] URLs now 'persist' through login, i.e. if you visited /user-management while not logged in, got redirected to the login page, then signed in, you'll automatically be redirected to /user-management (where in the past, you'd go to the home screen)
  • [x] sneaky lil animation for logging in

Backend

  • [x] Exposes whether email messaging is enabled via the health endpoint
  • [x] Email is now a required field on creating new users
  • [x] User object has two additional attributes: disabled and disabled_reason. A user pending an invite would have disabled=true and disabled_reason="pending_invite"
  • [x] Flow for sending an email with an invite code when a user is created
  • [x] New endpoint for accepting an invite
  • [x] Updated the create user CLI command to require an email

Steps to Confirm

  • [ ] Add FIDES__ADMIN_UI__URL="http://localhost:3000" to your .env file
  • [ ] Configure email messaging via the API, the Fides Postman collection makes this easy to do with these two API calls
    • [ ] Messaging Config - Email > Post Messaging Config
    • [ ] Messaging Config - Email > Messaging Config Secrets
  • [ ] In the Admin UI, navigate to Management > User Management and click Add New User
    • [ ] Fill out the form with an email address you have access to. Verify the password field is disabled, that's a quick way to verify that "invite users via email" is properly configured
  • [ ] Check your email, open the invite link in an incognito window to avoid conflicting with your current Admin UI session
  • [ ] Provide a password and submit, you should be redirected to the Admin UI landing page

Pre-Merge Checklist

galvana avatar Dec 21 '23 21:12 galvana