Skip to content

Commit

Permalink
Merge pull request #4155 from thematters/feat/update-facebook-app-id
Browse files Browse the repository at this point in the history
feat(facebook): update facebook api version and client id
  • Loading branch information
gary02 authored Jan 23, 2024
2 parents 900b8cc + 7b7dc1c commit aeaa616
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ NEXT_PUBLIC_USDT_CONTRACT_ADDRESS=0xfe4F5145f6e09952a5ba9e956ED0C25e3Fa4c7F1
NEXT_PUBLIC_CURATION_CONTRACT_ADDRESS=0xa219c6722008aa22828b31a13ab9ba93bb91222c
NEXT_PUBLIC_GOOGLE_CLIENT_ID=315393900359-2r9fundftis7dc0tdeo2hf8630nfdd8h.apps.googleusercontent.com
NEXT_PUBLIC_TWITTER_CLIENT_ID=X3d6Szg5bnVCMm5wRWxSVmhXUTc6MTpjaQ
NEXT_PUBLIC_FACEBOOK_CLIENT_ID=203337806078602
NEXT_PUBLIC_FACEBOOK_CLIENT_ID=1072677713882819
NEXT_PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY=0x4AAAAAAAKiedvR5qiLUhIs
NEXT_PUBLIC_NOMAD_MATTERS_CAMPAIGN_LINK=/@rsdyobw/22048-launching-the-nomad-matters-initiative
DEBUG=false
Expand Down
2 changes: 1 addition & 1 deletion src/common/utils/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const facebookOauthUrl = async (type: OauthType) => {
const { state, codeChallenge } = await generateSocialOauthParams(type)
const clientId = process.env.NEXT_PUBLIC_FACEBOOK_CLIENT_ID
const redirectUri = `https://${process.env.NEXT_PUBLIC_SITE_DOMAIN}/callback/${CALLBACK_PROVIDERS.Facebook}`
const url = `https://www.facebook.com/v17.0/dialog/oauth?response_type=code&scope=openid&client_id=${clientId}&redirect_uri=${redirectUri}&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256`
const url = `https://www.facebook.com/v18.0/dialog/oauth?response_type=code&scope=openid&client_id=${clientId}&redirect_uri=${redirectUri}&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256`
return url
}

Expand Down
20 changes: 10 additions & 10 deletions src/components/AuthMethodFeed/AuthNormalFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { FormattedMessage } from 'react-intl'

import { PATHS } from '~/common/enums'
import {
// facebookOauthUrl,
facebookOauthUrl,
googleOauthUrl,
sleep,
twitterOauthUrl,
} from '~/common/utils'
import {
// IconFacebook22,
IconFacebook22,
IconGoogle22,
IconMail22,
IconSpinner22,
Expand All @@ -32,7 +32,7 @@ export const AuthNormalFeed = ({ gotoEmailSignup, gotoEmailLogin }: Props) => {
const [loadingState, setLoadingState] = useState('')
const isGoogleLoading = loadingState === 'Google'
const isTwitterLoading = loadingState === 'Twitter'
// const isFacebookLoading = loadingState === 'Facebook'
const isFacebookLoading = loadingState === 'Facebook'
useEffect(() => {
return setLoadingState('')
}, [])
Expand Down Expand Up @@ -64,11 +64,11 @@ export const AuthNormalFeed = ({ gotoEmailSignup, gotoEmailLogin }: Props) => {
}
}

// const gotoFacebook = async () => {
// setLoadingState('Facebook')
// const url = await facebookOauthUrl(oauthType)
// router.push(url)
// }
const gotoFacebook = async () => {
setLoadingState('Facebook')
const url = await facebookOauthUrl(oauthType)
router.push(url)
}

return (
<>
Expand Down Expand Up @@ -103,7 +103,7 @@ export const AuthNormalFeed = ({ gotoEmailSignup, gotoEmailLogin }: Props) => {
</span>
)}
</li>
{/* <li className={styles.item} role="button" onClick={gotoFacebook}>
<li className={styles.item} role="button" onClick={gotoFacebook}>
<span className={styles.icon}>
<IconFacebook22 size="mdM" />
</span>
Expand All @@ -113,7 +113,7 @@ export const AuthNormalFeed = ({ gotoEmailSignup, gotoEmailLogin }: Props) => {
<IconSpinner22 color="grey" size="mdM" />
</span>
)}
</li> */}
</li>
</ul>
<section className={styles.info}>
<section className={styles.title}>
Expand Down
26 changes: 13 additions & 13 deletions src/views/Me/Settings/Account/Socials/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
OAUTH_STORAGE_BIND_STATE_UNAVAILABLE,
} from '~/common/enums'
import {
// facebookOauthUrl,
facebookOauthUrl,
googleOauthUrl,
isSafari,
sleep,
Expand All @@ -18,7 +18,7 @@ import {
} from '~/common/utils'
import {
IconClose20,
// IconFacebook22,
IconFacebook22,
IconGoogle22,
IconSpinner16,
IconX22,
Expand All @@ -41,9 +41,9 @@ const Socials = () => {
const googleId = viewer.info.socialAccounts.find(
(s) => s.type === SocialAccountType.Google
)?.email
// const facebookId = viewer.info.socialAccounts.find(
// (s) => s.type === SocialAccountType.Facebook
// )?.userName
const facebookId = viewer.info.socialAccounts.find(
(s) => s.type === SocialAccountType.Facebook
)?.userName
const twitterId = viewer.info.socialAccounts.find(
(s) => s.type === SocialAccountType.Twitter
)?.userName
Expand All @@ -52,7 +52,7 @@ const Socials = () => {
const [loadingState, setLoadingState] = useState('')
const isGoogleLoading = loadingState === 'Google'
const isTwitterLoading = loadingState === 'Twitter'
// const isFacebookLoading = loadingState === 'Facebook'
const isFacebookLoading = loadingState === 'Facebook'

const oauthType = 'bind'

Expand Down Expand Up @@ -81,11 +81,11 @@ const Socials = () => {
}
}

// const gotoFacebook = async () => {
// setLoadingState('Facebook')
// const url = await facebookOauthUrl(oauthType)
// router.push(url)
// }
const gotoFacebook = async () => {
setLoadingState('Facebook')
const url = await facebookOauthUrl(oauthType)
router.push(url)
}

useEffect(() => {
const bindResult = storage.remove(OAUTH_STORAGE_BIND_STATE)
Expand Down Expand Up @@ -227,7 +227,7 @@ const Socials = () => {
</RemoveSocialLoginDialog>

{/* Facebook */}
{/* <RemoveSocialLoginDialog type={SocialAccountType.Facebook}>
<RemoveSocialLoginDialog type={SocialAccountType.Facebook}>
{({ openDialog }) => {
return (
<TableView.Cell
Expand Down Expand Up @@ -263,7 +263,7 @@ const Socials = () => {
/>
)
}}
</RemoveSocialLoginDialog> */}
</RemoveSocialLoginDialog>
</>
)
}
Expand Down

0 comments on commit aeaa616

Please sign in to comment.