-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🪟 🧪 [Experiment] Show speedy connection banner only to corporate emails #19354
Changes from all commits
c734dc1
b659afe
c74001b
9efe5bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import { useAuth } from "packages/firebaseReact"; | |
import { useInitService } from "services/useInitService"; | ||
import { getUtmFromStorage } from "utils/utmStorage"; | ||
|
||
import { FREE_EMAIL_SERVICE_PROVIDERS } from "./freeEmailProviders"; | ||
import { actions, AuthServiceState, authStateReducer, initialState } from "./reducer"; | ||
import { EmailLinkErrorCodes } from "./types"; | ||
|
||
|
@@ -51,6 +52,7 @@ interface AuthContextApi { | |
loggedOut: boolean; | ||
providers: string[] | null; | ||
hasPasswordLogin: () => boolean; | ||
hasCorporateEmail: () => boolean; | ||
login: AuthLogin; | ||
loginWithOAuth: (provider: OAuthProviders) => Observable<OAuthLoginState>; | ||
signUpWithEmailLink: (form: { name: string; email: string; password: string; news: boolean }) => Promise<void>; | ||
|
@@ -170,6 +172,9 @@ export const AuthenticationProvider: React.FC<React.PropsWithChildren<unknown>> | |
hasPasswordLogin(): boolean { | ||
return !!state.providers?.includes("password"); | ||
}, | ||
hasCorporateEmail(): boolean { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added this new function here so it can be used across the whole app because I feel we will start segmenting more and more experiments only for corporate emails. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that might be a valid place for it. Alternatively we would put it into |
||
return !FREE_EMAIL_SERVICE_PROVIDERS.some((provider) => state.currentUser?.email.endsWith(`@${provider}`)); | ||
}, | ||
async login(values: { email: string; password: string }): Promise<void> { | ||
await authService.login(values.email, values.password); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that I noticed while testing: I'd suggest to remove the seconds from this counter. Having something ticking down every second of the top of the page feels really destracting from what you want to do on the page.