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

[CORL-3208] Display SSO duplicate email errors in the Relay network error prompt #4720

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

nick-funk
Copy link
Contributor

What does this PR do?

Displays the Specified email address is already in use message when a new SSO token has a conflicting email with an existing user.

image

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

None

Does this PR introduce any new environment variables or feature flags?

No

If any indexes were added, were they added to INDEXES.md?

N/A

How do I test this PR?

Using multi-site-test, set up an SSO secret and two unique users with the same email payload:

"sso": {
        "secret": "ssosec_f73a2830f6285...",
        "users": [
          {
            "id": "95b83d1d-c15b-40e6-adbe-d4f07ace3fae",
            "username": "dupe1",
            "email": "dupe@test.com",
            "role": "COMMENTER",
            "badges": []
          },
          {
            "id": "4d7d6d87-769c-40cd-8550-8ea0537d29ee",
            "username": "dupe2",
            "email": "dupe@test.com",
            "role": "COMMENTER",
            "badges": []
          },
         ...
  • run the site and ensure it's allowed in Coral allowed domains (under organization, sites)
    • be sure to allow registration
  • see that when you view the first user, then second user (or vice versa) it shows that the second user you try and sign in as receives the dupe email error

Were any tests migrated to React Testing Library?

No

How do we deploy this PR?

  • Merge to develop

`pnpm run --parallel` breaks execution of the build
script in dev mode and results in us only generating
types during `pnpm run build:development` or
`sh scripts/build-development.sh`
@nick-funk nick-funk requested review from kabeaty and tessalt January 13, 2025 21:33
Copy link

netlify bot commented Jan 13, 2025

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit 797faa7
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/678586a252addb0008dc1b58

@@ -22,7 +22,7 @@
"description": "A better commenting experience from Vox Media.",
"scripts": {
"build:client": "NODE_OPTIONS=\"--openssl-legacy-provider --no-experimental-fetch\" ts-node --transpile-only ./scripts/build.ts",
"build:development": "NODE_OPTIONS=\"--openssl-legacy-provider --no-experimental-fetch\" NODE_ENV=development pnpm run --parallel generate build:client",
"build:development": "NODE_OPTIONS=\"--openssl-legacy-provider --no-experimental-fetch\" NODE_ENV=development pnpm run generate && pnpm run build:client",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this fixes the dev client builds not actually compiling (transpiling) the client TS code and it only doing the generate steps

Copy link
Contributor

@kabeaty kabeaty 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 and works as expected to show duplicate email error!

@tessalt tessalt merged commit 14cdd0b into develop Jan 14, 2025
6 checks passed
@tessalt tessalt deleted the fix/CORL-3208-sso-dupe-email-errors branch January 14, 2025 16:02
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