Skip to content

Commit

Permalink
Remove hiding google sso (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks19 authored Feb 27, 2024
1 parent c0a2c26 commit e2584a8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import withStyles from 'react-jss'
import type { SaladTheme } from '../../../../SaladTheme'
import { DefaultTheme } from '../../../../SaladTheme'
import { Head } from '../../../../components'
import { config } from '../../../../config'
import { withLogin } from '../../../auth-views'
import type { Avatar, Profile } from '../../../profile/models'
import { AccountTermsAndConditionsUpdate } from './AccountTermsAndConditionsUpdate'
Expand Down Expand Up @@ -143,15 +142,10 @@ const _Account: FC<Props> = ({
}) => {
const [payPalLoadRetries, setPayPalLoadRetries] = useState(0)

// Hide google SSO until salad google account devops setup
const hideGoogleSSO = !config.isTestEnvironment

useEffect(() => {
loadPayPalId()

if (!hideGoogleSSO) {
loadGoogleAccountConnection()
}
loadGoogleAccountConnection()

return () => {
clearInterval(intervalId)
Expand Down Expand Up @@ -250,43 +244,41 @@ const _Account: FC<Props> = ({
)}
</div>
</div>
{!hideGoogleSSO && (
<div className={classes.accountConnectionItem}>
<div className={classes.subheadingContainer}>
<Text variant="baseL">Google</Text>
</div>
<div className={classes.connectAccountButtonContainer}>
{connectedGoogleAccountEmail ? (
<>
<Text variant="baseS">Google Email Address</Text>
<Text variant="baseL">
<div className={classes.connectedGoogleAccountEmail}>{connectedGoogleAccountEmail}</div>
</Text>
</>
) : (
<>
<GoogleSignInForm
isTermsAndConditionsAccepted={isTermsAndConditionsAccepted}
isTermsAndConditionsRequired={shouldShowUpdateAccountTermsAndConditions}
/>
{isLoadConnectedGoogleAccountEmailError && (
<div className={classes.connectAccountError}>
<Text variant="baseS">
Unable to fetch connected Google Account. Please try to refresh the page.
</Text>
</div>
)}
<div className={classes.connectAccountDescription}>
<div className={classes.accountConnectionItem}>
<div className={classes.subheadingContainer}>
<Text variant="baseL">Google</Text>
</div>
<div className={classes.connectAccountButtonContainer}>
{connectedGoogleAccountEmail ? (
<>
<Text variant="baseS">Google Email Address</Text>
<Text variant="baseL">
<div className={classes.connectedGoogleAccountEmail}>{connectedGoogleAccountEmail}</div>
</Text>
</>
) : (
<>
<GoogleSignInForm
isTermsAndConditionsAccepted={isTermsAndConditionsAccepted}
isTermsAndConditionsRequired={shouldShowUpdateAccountTermsAndConditions}
/>
{isLoadConnectedGoogleAccountEmailError && (
<div className={classes.connectAccountError}>
<Text variant="baseS">
Connect Salad to your Google account. A Google account allows you to sign in easily to Salad
using Google SSO.
Unable to fetch connected Google Account. Please try to refresh the page.
</Text>
</div>
</>
)}
</div>
)}
<div className={classes.connectAccountDescription}>
<Text variant="baseS">
Connect Salad to your Google account. A Google account allows you to sign in easily to Salad
using Google SSO.
</Text>
</div>
</>
)}
</div>
)}
</div>
<div className={classes.accountConnectionItem}>
<div className={classes.subheadingContainer}>
<Text variant="baseL">Minecraft</Text>
Expand Down
7 changes: 0 additions & 7 deletions packages/web-app/src/modules/profile/ProfileStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { AxiosInstance, AxiosResponse } from 'axios'
import { action, computed, flow, observable } from 'mobx'
import * as Storage from '../../Storage'
import type { RootStore } from '../../Store'
import { config } from '../../config'
import type { FormValues } from '../account-views/account-views/components/'
import { NotificationMessageCategory } from '../notifications/models'
import {
Expand Down Expand Up @@ -303,12 +302,6 @@ export class ProfileStore {

@action.bound
loadGoogleAccountConnection = flow(function* (this: ProfileStore) {
// Hide google SSO until salad google account devops setup
const hideGoogleSSO = !config.isTestEnvironment
if (hideGoogleSSO) {
return
}

try {
this.isLoadConnectedGoogleAccountEmailError = false
this.connectExternalAccountProvider()
Expand Down

0 comments on commit e2584a8

Please sign in to comment.