Skip to content

Commit 04ea659

Browse files
committed
quick FB prettiness
1 parent c2db231 commit 04ea659

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/actions/authActions.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { LOGIN_SUCCESS, LOGOUT_SUCCESS } from "./actionTypes";
22
import Expo from "expo";
33
const getFBToken = Expo.Facebook.logInWithReadPermissionsAsync;
4+
const fbURL = "https://graph.facebook.com/";
45

56
const 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

0 commit comments

Comments
 (0)