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

Feat: prevent non work emails #3993

Merged
merged 18 commits into from
Feb 26, 2025
Merged

Feat: prevent non work emails #3993

merged 18 commits into from
Feb 26, 2025

Conversation

Mikehrn
Copy link
Contributor

@Mikehrn Mikehrn commented Feb 16, 2025

This blocks signing up with a non-work email, as an experiment to see how it impacts our numbers. @cdriesler I gave blocking it when using single sign-on a shot, but not sure if this is correct. Please roast me if needed :D

I will leave this as a draft for now. Dont merge yet.

Screenshot 2025-02-16 at 21 32 53

@benjaminvo
Copy link
Contributor

  1. Is this blocking only implemented on our server? I couldn't immediately see that from the code. But I guess it should.
  2. Have you tested how it works for invites? Flow: Receive invite on a blocked email domain -> Open signup screen with the email pre-filled -> Here we probably shouldn't block.
  3. Are you also blocking using a Google SSO button?

@Mikehrn
Copy link
Contributor Author

Mikehrn commented Feb 16, 2025

  1. Is this blocking only implemented on our server? I couldn't immediately see that from the code. But I guess it should.
  2. Have you tested how it works for invites? Flow: Receive invite on a blocked email domain -> Open signup screen with the email pre-filled -> Here we probably shouldn't block.
  3. Are you also blocking using a Google SSO button?
  1. Yeah there is no difference now, but you're right, I'm however not sure how we can do that atm, afaik there is no isSpeckle method. Maybe we should do it with a FF?
  2. Good point, should we block invites with blocked domains, or do we still want to allow those? In essence it's the same as signing up
  3. I think it should capture both, but I need @cdriesler to help me validate this, as I'm not very familiar with the server part of the auth

@cdriesler
Copy link
Member

What you've done to block domains on the backend is sound, but I would put the same logic within the body of createUser to capture all pathways (email/password, server-level SSO, workspace SSO, etc). Will push the change to this branch tomorrow.

How this will behave with Google SSO is that they will always be able to complete the sign in flow, but we'll prevent new user registration if the email is on the blacklist. So "[email protected]" is ok, but "[email protected]" is not.

I'll take a look at how we can limit this set of changes to app.speckle.systems. Each server declares its "canonical URL" and I think we're safe to use that.

@Mikehrn
Copy link
Contributor Author

Mikehrn commented Feb 16, 2025

What you've done to block domains on the backend is sound, but I would put the same logic within the body of createUser to capture all pathways (email/password, server-level SSO, workspace SSO, etc). Will push the change to this branch tomorrow.

How this will behave with Google SSO is that they will always be able to complete the sign in flow, but we'll prevent new user registration if the email is on the blacklist. So "[email protected]" is ok, but "[email protected]" is not.

I'll take a look at how we can limit this set of changes to app.speckle.systems. Each server declares its "canonical URL" and I think we're safe to use that.

Checking canonical URL sounds easy, vs a FF which one you think makes most sense? I have local changes to add the FF if we wanna go that route 😄

Copy link
Contributor

And remember that this is an experiment for now. So we should try to be pragmatic if there are ways to cut corners.

@cdriesler
Copy link
Member

What you've done to block domains on the backend is sound, but I would put the same logic within the body of createUser to capture all pathways (email/password, server-level SSO, workspace SSO, etc). Will push the change to this branch tomorrow.
How this will behave with Google SSO is that they will always be able to complete the sign in flow, but we'll prevent new user registration if the email is on the blacklist. So "[email protected]" is ok, but "[email protected]" is not.
I'll take a look at how we can limit this set of changes to app.speckle.systems. Each server declares its "canonical URL" and I think we're safe to use that.

Checking canonical URL sounds easy, vs a FF which one you think makes most sense? I have local changes to add the FF if we wanna go that route 😄

Probably both is good imo!

@Mikehrn
Copy link
Contributor Author

Mikehrn commented Feb 16, 2025

And remember that this is an experiment for now. So we should try to be pragmatic if there are ways to cut corners.

FE-wise the only question is wether to block personal emails in invite or allow them, either isn't much work, it's mostly a product question

@benjaminvo
Copy link
Contributor

And remember that this is an experiment for now. So we should try to be pragmatic if there are ways to cut corners.

FE-wise the only question is wether to block personal emails in invite or allow them, either isn't much work, it's mostly a product question

When blocking in invite would you do it in the actual invite flow or when the user tries to sign up using that email? Or both.

I'm not sure yet if blocking on invite is needed to start. I don't think so right now.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

@Mikehrn Mikehrn marked this pull request as ready for review February 18, 2025 10:27
Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

Copy link
Contributor

📸 Preview service has generated an image.

gjedlicska
gjedlicska previously approved these changes Feb 24, 2025
@gjedlicska gjedlicska self-requested a review February 26, 2025 09:12
@@ -89,6 +89,11 @@
"type": "boolean",
"description": "Forces onboarding for all users",
"default": false
},
"noPersonalEmailsEnabled": {
Copy link
Contributor

Choose a reason for hiding this comment

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

The negation (no) is tricky to decipher. Might have been better as AllowPersonalEmails or PersonalEmailsEnabled, and flip the logic internally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't that cause it to block personal emails on all deployments? This is an experiment we want to run briefly, maybe just a week or so, to see the results on app. For now this is not a permanent product change so should have as little impact as possible on other deployments

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be true (i.e. existing behaviour) by default.

Copy link
Contributor Author

@Mikehrn Mikehrn Feb 26, 2025

Choose a reason for hiding this comment

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

Ah yeah true, good morning, I don't really wanna spend too much more time on this, I think we should go with this for now, and we can improve if it this becomes a permanent change (I do agree with your point tho)

@@ -130,7 +130,7 @@ describe('GraphQL @apps-api', () => {
;({ sendRequest } = await initializeTestServer(ctx))
testUser = {
name: 'Dimitrie Stefanescu',
email: 'didimitrie@gmail.com',
email: 'didimitrie@example.org',
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, I like the example.org usage 👍

Copy link
Contributor

📸 Preview service has generated an image.

@Mikehrn Mikehrn merged commit 2ecb981 into main Feb 26, 2025
27 of 29 checks passed
@Mikehrn Mikehrn deleted the mike/prevent-non-work-emails branch February 26, 2025 09:55
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.

6 participants