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

PLU-91: [SGID-LOGIN-5] **RFC** Enable multi-hat users to select email #206

Merged

Conversation

ogp-weeloong
Copy link
Contributor

@ogp-weeloong ogp-weeloong commented Sep 11, 2023

Problem

We want to support SGID login as an alternative to OTP.

Solution

As opposed to the usual SGID approach of creating routes on the back end, we will implement SGID using front end routes + GraphQL instead (to avoid us mixing and matching classic REST vs GraphQL where possible).

High Level Approach

See #202 for full details.

  1. Create a new "login with SGID" GraphQL mutation, which logs in users with a single work email, or return the list of work emails to the front end.
  2. Create a new "login with selected SGID" mutation, which logs multi-hatted users in after they have selected their email.
  3. Create a new login with SGID button, which sends the user to the SGID servers to start the login process
  4. Add a new front end route, /login/sgid/redirect, which processes auth data from SGID + renders work email list for selection.

PR Notes

This PR enhances step 4 to enable multi-hatted users to select and login with a particular work email.

RFC Needed

UX inputs pls.

SCREENSHOTS
Screenshot 2023-09-11 at 10 30 47 PM

Tests

  • Simulate having multiple emails by editing the loginWithSgid mutation, and check that I get redirected to this selection screen.
  • From the previous test, select an email and check that I am logged in with the correct email.
  • Manually send a wrong email to this mutation and check that I get an error instead of being successfully logged in.
  • Regression test: check that I can still login with OTP
  • Regression test: check that I can still login with SGID as a single hat user, without seeing this selection screen.

@linear
Copy link

linear bot commented Sep 11, 2023

@ogp-weeloong ogp-weeloong changed the title PLU-91: [SGID-LOGIN-5] Enable multi-hat users to select email PLU-91: [SGID-LOGIN-5] **RFC** Enable multi-hat users to select email Sep 11, 2023
* chore: refactor naming and update styles

* PLU-91: [SGID-LOGIN-6] Set up per-env SGID client IDs (#214)

---------

Co-authored-by: Kuan Wee Loong <[email protected]>
@ogp-weeloong ogp-weeloong merged commit 9a9af42 into feat/sgid/multi-hat/mutation Sep 15, 2023
@ogp-weeloong ogp-weeloong deleted the feat/sgid/multi-hat/selection branch September 15, 2023 06:14
ogp-weeloong added a commit that referenced this pull request Sep 15, 2023
* feat: multi-hat mutation

* PLU-91: [SGID-LOGIN-5] **RFC** Enable multi-hat users to select email (#206)

* chore: refactor naming and update styles (#213)

* PLU-91: [SGID-LOGIN-6] Set up per-env SGID client IDs (#214)

---------

Co-authored-by: Kuan Wee Loong <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
ogp-weeloong added a commit that referenced this pull request Sep 15, 2023
* feat: sgid failure page

* PLU-91: [SGID-LOGIN-4] Support multi-hat SGID users  (#205)

* PLU-91: [SGID-LOGIN-5] **RFC** Enable multi-hat users to select email (#206)

* chore: refactor naming and update styles (#213)

* PLU-91: [SGID-LOGIN-6] Set up per-env SGID client IDs (#214)

---------

Co-authored-by: Kuan Wee Loong <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
ogp-weeloong added a commit that referenced this pull request Sep 15, 2023
* feat: add sgid login button

* PLU-91: [SGID-LOGIN-3] Implement SGID failure modal (#204)

* PLU-91: [SGID-LOGIN-4] Support multi-hat SGID users  (#205)

* PLU-91: [SGID-LOGIN-5] **RFC** Enable multi-hat users to select email (#206)

* chore: refactor naming and update styles (#213)

* PLU-91: [SGID-LOGIN-6] Set up per-env SGID client IDs (#214)

---------

Co-authored-by: Kuan Wee Loong <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
ogp-weeloong added a commit that referenced this pull request Sep 15, 2023
* chore: add sgid sdk

* feat: sgid login mutation

* PLU-91: [SGID-LOGIN-2] Implement SGID login button (#203)

* feat: add sgid login button

* PLU-91: [SGID-LOGIN-3] Implement SGID failure modal (#204)

* PLU-91: [SGID-LOGIN-4] Support multi-hat SGID users  (#205)

* PLU-91: [SGID-LOGIN-5] **RFC** Enable multi-hat users to select email (#206)

* chore: refactor naming and update styles (#213)

* PLU-91: [SGID-LOGIN-6] Set up per-env SGID client IDs (#214)

---------

Co-authored-by: Kuan Wee Loong <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
ogp-weeloong added a commit that referenced this pull request Sep 19, 2023
* chore: add sgid sdk

* feat: sgid login mutation

* PLU-91: [SGID-LOGIN-2] Implement SGID login button (#203)

* feat: add sgid login button

* PLU-91: [SGID-LOGIN-3] Implement SGID failure modal (#204)

* PLU-91: [SGID-LOGIN-4] Support multi-hat SGID users  (#205)

* PLU-91: [SGID-LOGIN-5] **RFC** Enable multi-hat users to select email (#206)

* chore: refactor naming and update styles (#213)

* PLU-91: [SGID-LOGIN-6] Set up per-env SGID client IDs (#214)

---------

Co-authored-by: Kuan Wee Loong <[email protected]>
Co-authored-by: Ian Chen <[email protected]>
# Conflicts:
#	packages/frontend/src/theme/foundations/textStyles.ts
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.

2 participants