Skip to content

Commit

Permalink
remove Facebook login (#1239)
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree authored Mar 26, 2024
1 parent 486431f commit 0feae31
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 162 deletions.
5 changes: 0 additions & 5 deletions app/API/http_api/current_user.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ export const signUp = (userParams, invitationToken) => {
return HttpApi.post('users', { user: userParams, invitation_token: invitationToken })
}

/** Unlink a third-party account. */
export const unlinkProvider = (provider) => {
return HttpApi.delete(`auth/${provider}/link`)
}

/** Request a password reset for given email */
export const resetPasswordRequest = (email) => {
return HttpApi.post('users/reset_password/request', { email })
Expand Down
2 changes: 0 additions & 2 deletions app/components/Users/LoginForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { signIn } from '../../API/http_api/current_user'
import { tError } from '../../lib/errors'
import { withLoggedInUser } from '../LoggedInUser/UserProvider'
import Alert from '../Utils/Alert'
import ThirdPartyAuthList from './ThirdPartyAuthList'
import { submitButton, UserEmailOrUsernameField, UserPasswordField } from './UserFormFields'

@reduxForm({ form: 'loginForm' })
Expand Down Expand Up @@ -71,7 +70,6 @@ export default class LoginForm extends React.PureComponent {
<UserEmailOrUsernameField t={t} />
<UserPasswordField t={t} />
{submitButton(t('login'), valid)}
<ThirdPartyAuthList />
</form>
)
}
Expand Down
2 changes: 0 additions & 2 deletions app/components/Users/SignupForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { P } from '../StyledUtils/Text'
import Alert from '../Utils/Alert'
import Message from '../Utils/Message'
import InvitationRequestForm from './InvitationRequestForm'
import ThirdPartyAuthList from './ThirdPartyAuthList'
import { renderAllUserFields, submitButton, validatePasswordRepeat } from './UserFormFields'

const SignupForm = ({ location, t }) => {
Expand Down Expand Up @@ -84,7 +83,6 @@ class RealSignupForm extends React.PureComponent {
<Link to="/help/privacy">{t('privacyLinkLabel')}</Link>.
</P>
{submitButton(t('signup'), valid)}
<ThirdPartyAuthList />
</form>
)
}
Expand Down
35 changes: 0 additions & 35 deletions app/components/Users/ThirdPartyAccountLinker.jsx

This file was deleted.

17 changes: 0 additions & 17 deletions app/components/Users/ThirdPartyAuthList.jsx

This file was deleted.

46 changes: 0 additions & 46 deletions app/components/Users/ThirdPartyCallback.jsx

This file was deleted.

16 changes: 1 addition & 15 deletions app/components/Users/UserSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ import { withNamespaces } from 'react-i18next'
import { connect } from 'react-redux'

import { deleteUserAccount } from '../../API/http_api/current_user'
import { facebookAuthUrl } from '../../lib/third_party_auth'
import { addModal, popModal } from '../../state/modals/reducer'
import UserLanguageSelector from '../LoggedInUser/UserLanguageSelector'
import { withLoggedInUser } from '../LoggedInUser/UserProvider'
import Button from '../Utils/Button'
import { LoadingFrame } from '../Utils/LoadingFrame'
import DeleteUserModal from './DeleteUserModal'
import EditUserForm from './EditUserForm'
import ThirdPartyAccountLinker from './ThirdPartyAccountLinker'

@connect((state) => ({ locale: state.UserPreferences.locale }), { addModal, popModal })
@withNamespaces('user')
@withLoggedInUser
export default class UserSettings extends React.PureComponent {
render() {
const { t, addModal, loggedInUser, locale, logout } = this.props
const { t, addModal, locale, logout } = this.props
return this.props.isLoading ? (
<LoadingFrame />
) : (
Expand All @@ -39,18 +37,6 @@ export default class UserSettings extends React.PureComponent {
<br />
<hr />
<br />
<div className="has-text-centered">
<h3 className="title is-3">{t('linkedAccounts')}</h3>
<ThirdPartyAccountLinker
provider="facebook"
title="Facebook"
isLinked={!!loggedInUser.fb_user_id}
authURL={facebookAuthUrl()}
/>
</div>
<br />
<hr />
<br />
<div className="has-text-centered">
<h3 className="title is-3">{t('browsingAnalyzer')}</h3>
<iframe
Expand Down
11 changes: 0 additions & 11 deletions app/lib/third_party_auth.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/router.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import NewsletterSubscription from './components/Users/NewsletterSubscription'
import ResetPasswordConfirmForm from './components/Users/ResetPasswordConfirmForm'
import ResetPasswordRequestForm from './components/Users/ResetPasswordRequestForm'
import SignupForm from './components/Users/SignupForm'
import ThirdPartyCallback from './components/Users/ThirdPartyCallback'
import User from './components/Users/User'
import UserProfile from './components/Users/UserProfile'
import UserSettings from './components/Users/UserSettings'
Expand All @@ -36,10 +35,8 @@ const CFRouter = () => (
<Switch>
<Route path="/" exact component={Home} />
<Route path="/signup" exact component={SignupForm} />
<Route path="/signup/callback/:provider" exact component={ThirdPartyCallback} />
<Route path="/login" exact component={LoginForm} />
<Route path="/logout" exact component={LogoutPage} />
<Route path="/login/callback/:provider" exact component={ThirdPartyCallback} />
<Route path="/confirm_email/:token" exact component={ConfirmEmail} />
<Route path="/reset_password" exact component={ResetPasswordRequestForm} />
<Route path="/reset_password/confirm/:token" exact component={ResetPasswordConfirmForm} />
Expand Down
5 changes: 0 additions & 5 deletions app/styles/_components/User/authenticate.sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@

.modal .user-form
padding-top: 20px

.third-party-auth
max-width: 600px
margin: 50px auto 20px
text-align: center
40 changes: 19 additions & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
version: "3.1"
version: '3.1'
services:
# Pre-seeded postgres Database
database:
image: "captainfact/dev-db:latest"
ports: ["5432:5432"]
image: 'captainfact/dev-db:latest'
ports: ['5432:5432']

# Main API - REST + Websockets
api:
image: captainfact/rest-api:staging
command: foreground
ports: ["4000:80"]
depends_on: ["database"]
ports: ['4000:80']
depends_on: ['database']
environment:
MIX_ENV: dev
CF_SECRET_KEY_BASE: "8C6FsJwjV11d+1WPUIbkEH6gB/VavJrcXWoPLujgpclfxjkLkoNFSjVU9XfeNm6s"
CF_SECRET_KEY_BASE: '8C6FsJwjV11d+1WPUIbkEH6gB/VavJrcXWoPLujgpclfxjkLkoNFSjVU9XfeNm6s'
CF_HOST: localhost
CF_DB_HOSTNAME: database
CF_DB_USERNAME: postgres
CF_DB_PASSWORD: postgres
CF_DB_NAME: captain_fact_dev
CF_FACEBOOK_APP_ID: xxxxxxxxxxxxxxxxxxxx
CF_FACEBOOK_APP_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CF_FRONTEND_URL: "http://localhost:3333"
CF_CHROME_EXTENSION_ID: "chrome-extension://fnnhlmbnlbgomamcolcpgncflofhjckm"
CF_FRONTEND_URL: 'http://localhost:3333'
CF_CHROME_EXTENSION_ID: 'chrome-extension://fnnhlmbnlbgomamcolcpgncflofhjckm'

# Public GaphQL API
graphql-api:
image: captainfact/graphql-api:staging
command: foreground
ports: ["4002:80"]
depends_on: ["database", "api"]
ports: ['4002:80']
depends_on: ['database', 'api']
environment:
MIX_ENV: dev
CF_HOST: "localhost"
CF_BASIC_AUTH_PASSWORD: ""
CF_HOST: 'localhost'
CF_BASIC_AUTH_PASSWORD: ''
CF_DB_HOSTNAME: database
CF_DB_USERNAME: postgres
CF_DB_PASSWORD: postgres
Expand All @@ -43,11 +41,11 @@ services:
atom-feed:
image: captainfact/atom-feed:staging
command: foreground
ports: ["4004:80"]
depends_on: ["database", "api"]
ports: ['4004:80']
depends_on: ['database', 'api']
environment:
MIX_ENV: dev
CF_HOST: "localhost"
CF_HOST: 'localhost'
CF_DB_HOSTNAME: database
CF_DB_USERNAME: postgres
CF_DB_PASSWORD: postgres
Expand All @@ -57,11 +55,11 @@ services:
opengraph:
image: captainfact/opengraph:staging
command: foreground
ports: ["4005:80"]
depends_on: ["database", "api"]
ports: ['4005:80']
depends_on: ['database', 'api']
environment:
MIX_ENV: dev
CF_HOST: "localhost"
CF_HOST: 'localhost'
CF_DB_HOSTNAME: database
CF_DB_USERNAME: postgres
CF_DB_PASSWORD: postgres
Expand All @@ -71,7 +69,7 @@ services:
jobs:
image: captainfact/jobs:staging
command: foreground
depends_on: ["database"]
depends_on: ['database']
environment:
MIX_ENV: dev
CF_DB_HOSTNAME: database
Expand Down

0 comments on commit 0feae31

Please sign in to comment.