-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
🪟 🎉 Enable OAuth login #15414
🪟 🎉 Enable OAuth login #15414
Conversation
} from "firebase/auth"; | ||
|
||
import { Provider } from "config"; | ||
import { FieldError } from "packages/cloud/lib/errors/FieldError"; | ||
import { EmailLinkErrorCodes, ErrorCodes } from "packages/cloud/services/auth/types"; | ||
|
||
interface AuthService { |
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.
ℹ️ We never exported this type, and implementing the interface in TypeScript does not even help not needing to respecify the types in the GoogleAuthService
anyway. Thus this interface is not really fulfilling any purpose (besides needing to arbitrarily type the method signature twice) and I removed it.
interface AuthContextApi { | ||
user: User | null; | ||
inited: boolean; | ||
emailVerified: boolean; | ||
isLoading: boolean; | ||
loggedOut: boolean; | ||
login: AuthLogin; | ||
loginWithOAuth: (provider: OAuthProviders) => Observable<OAuthLoginState>; |
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.
ℹ️ This method returns an Obersvable, since we need to know in the UI, when the middle of the method starts (the user selected an account, and we start loading the user), to show the loading spinner. Thus we can't express that with a Promise.
name: user.name, | ||
email: user.email, | ||
// Which login provider was used, e.g. "password", "google.com", "github.com" | ||
provider: fbUser.providerData[0]?.providerId, |
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.
ℹ️ There is a chance a firebase user has multiple providers linked (e.g. mail and google as mentioned in the PR description). But that shouldn't be the case when the user is just created, in which case they should only have one provider linked, thus we can simply take the first provider here for sending the event.
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.
Initial feedback. I have not tested the changes locally.
airbyte-webapp/src/packages/cloud/services/auth/AuthService.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/services/auth/AuthService.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/services/auth/AuthService.tsx
Outdated
Show resolved
Hide resolved
|
||
&:hover, | ||
&:focus { | ||
box-shadow: 0 1px 3px rgba(53, 53, 66, 0.2), 0 1px 2px rgba(53, 53, 66, 0.12), 0 1px 1px rgba(53, 53, 66, 0.14); |
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.
Where did these drop shadow colors come from?
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.
This shadow is from the regular button components. Most likely better to exctract it into a SASS variable. Any preference for which file?
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.
airbyte-webapp/src/scss/_variables.scss
seems the most appropriate, though a new file might be better. Not sure it's worth making a new file.
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.
@edmundito Any preferences for a file we should pack this into?
airbyte-webapp/src/packages/cloud/views/auth/OAuthLogin/OAuthLogin.tsx
Outdated
Show resolved
Hide resolved
airbyte-webapp/src/packages/cloud/views/auth/OAuthLogin/OAuthLogin.tsx
Outdated
Show resolved
Hide resolved
@timroes looks like the most recent changes include removing the checkbox to agree to the TOS and the PP. Could you update the title/description of this PR? |
@edmundito updated it in the description! |
airbyte-webapp/src/packages/cloud/views/users/AccountSettingsView/AccountSettingsView.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com>
This is the prior and desired behavior at the moment (we'll later make this disabled by default, for users coming from GDPR affected countries).
This issue is also on master, and since it might touch more code again (e.g. the scaling of the iframe might need to be addressed as well?) I'd prefer if we don't mix the fix into this PR.
This was also present beforehand, and it makes sense to change this whole page to use flexbox or grid. So same here: if possible I'd prefer moving that into a separate PR, if it would be okay for you? |
This appears to be working as expected locally 👍 |
Created #15650 to track the scroll issues on the login/sign-up page. |
* Enable OAuth login * Style buttons * Make sure to hide error wrapper without error * Extract OAuthProviders type * Make google login button outline more visible * Add provider to segment identify call * Switch TOS checkbox by disclaimer * Address review feedback * Hide password change section for OAuth accounts * Update airbyte-webapp/src/packages/cloud/locales/en.json Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com> * Address review feedback * Add additional flags to disable on sign-up * Adding more tests * Review feedback * Fix broken linting Co-authored-by: Edmundo Ruiz Ghanem <168664+edmundito@users.noreply.github.com>
What
Closes https://github.com/airbytehq/airbyte-cloud/issues/1429
This implements OAuth login for our cloud application.
This does not require any backend changes, since Firebase gives us the same JWTs that already work on the backend. We have on frontend-dev a Google and GitHub dev application enabled, so this can fully tested against frontend-dev. Also LaunchDarkly currently has both login mechanism enabled on LaunchDarkly.
Some notes around behavior/function:
"auth/account-exists-with-different-credential"
error code, which we show a warning for to log in using email/password.