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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: update facebook sdk and implement limited login #10143
Conversation
@@ -9529,6 +9529,11 @@ jws@^3.2.2: | |||
jwa "^1.4.1" | |||
safe-buffer "^5.0.1" | |||
|
|||
jwt-decode@4.0.0: |
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.
need new dep for decoding jwts from Facebook to get user info
import { jwtDecode } from "jwt-decode" | ||
import { capitalize } from "lodash" | ||
import { Alert } from "react-native" | ||
import { |
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 file just moved some existing helpers from AuthModel the make that file a little easier to read, most already existed a few new ones for limited login.
} | ||
} | ||
|
||
export async function handleLimitedFacebookAuth( |
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 is the major new behavior, on iOS we use the new jwt auth for both sign in and sign up
|
||
interface FacebookLimitedOAuthParams { | ||
oauthProvider: "facebook" | ||
oauthMode: "jwt" |
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.
since Facebook now has 2 different oauth modes this param is necessary to decouple oauth modes from providers on backend
id_token: oauthProvider === "apple" ? args.idToken : undefined, | ||
grant_type: grantTypeMap[oauthProvider], | ||
id_token: oauthMode === "idToken" ? args.idToken : undefined, | ||
grant_type: grantTypeMap[oauthMode], |
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.
similarly, use oauthMode rather than provider name when choosing params
@@ -126,9 +126,9 @@ target 'Artsy' do | |||
pod 'Pulley', git: 'https://github.com/artsy/Pulley.git', branch: 'master' | |||
|
|||
pod 'FBSDKCoreKit', '~> 16.3.1' | |||
pod 'FBSDKLoginKit', '~> 16.3.1' | |||
pod 'FBSDKShareKit', '~> 16.3.1' |
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.
tangent: we have a bunch of deps explicitly listed in the podfile that we get automatically through the associated node_module deps, this makes it harder to upgrade, we should probably remove from the Podfile.
This PR resolves PHIRE-736
Description
Depends on backend changes to auth code, draft until then.
Experience
For the user the experience is almost exactly the same except the Facebook domain is limited.facebook.com in the new oauth flow.
Limited Sign in iOS
limited-sign-in.mov
Limited Sign up iOS
limited-sign-up.mov
Classic Sign in Android
android-fb-login.mov
Classic Sign up Android
android-fb-signup.mov
Testing Done
iOS:
Android:
Follow-ups
PR Checklist
To the reviewers 馃憖
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.