Skip to content
Snippets Groups Projects
Commit 88994890 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Use id instead of link to identify Facebook users

The link property of Facebook Oauth profiles no longer has a consistent
value across logins and will be completly removed in future versions of
Facebook's Graph API.

We generate a link in the old format from the id for backwards
compatibility.
parent 9598e599
No related merge requests found
Pipeline #17499 passed with stages
in 1 minute and 59 seconds
......@@ -40,6 +40,8 @@ public class User implements Serializable {
public static final String ANONYMOUS = "anonymous";
public static final String GUEST = "guest";
public static final String FACEBOOK_LINK_PATTERN = "https://www.facebook.com/app_scoped_user_id/%s/";
private static final long serialVersionUID = 1L;
private String username;
private String type;
......@@ -57,7 +59,8 @@ public class User implements Serializable {
}
public User(FacebookProfile profile) {
setUsername(profile.getProfileUrl().toString());
/* A URL is built for backwards compatibility. */
setUsername(String.format(FACEBOOK_LINK_PATTERN, profile.getId()));
setType(User.FACEBOOK);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment