File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 11import { LOGIN_SUCCESS , LOGOUT_SUCCESS } from "./actionTypes" ;
22import Expo from "expo" ;
33const getFBToken = Expo . Facebook . logInWithReadPermissionsAsync ;
4+ const fbURL = "https://graph.facebook.com/" ;
45
56const loginAction = user => {
67 return {
@@ -21,9 +22,7 @@ async function login() {
2122 } ) ;
2223 if ( type === "success" ) {
2324 // Get the user's name using Facebook's Graph API
24- const response = await fetch (
25- `https://graph.facebook.com/me?access_token=${ token } `
26- ) ;
25+ const response = await fetch ( `${ fbURL } me?access_token=${ token } ` ) ;
2726 user = await response . json ( ) ;
2827 user . token = token ;
2928 return loginAction ( user ) ;
@@ -36,7 +35,7 @@ async function initializeAuth(user) {
3635 return logoutAction ( ) ;
3736 }
3837 const response = await fetch (
39- `https://graph.facebook.com/ debug_token?input_token=${ user . token } &access_token=${ user . token } `
38+ `${ fbURL } debug_token?input_token=${ user . token } &access_token=${ user . token } `
4039 ) ;
4140 tokenInfo = await response . json ( ) ;
4241
You can’t perform that action at this time.
0 commit comments