API method to validate Facebook OAuth token
I am new to Java / OOP and I'm concerned that I have a method which is doing far too much "stuff" - but I don't easily see how it can be shortened in a way which is not contrived / arbitrary.This is a...
View ArticleAnswer by Alexei for API method to validate Facebook OAuth token
I am mainly a C# .NET developer, but Java code seems quite clear for me. Your code seems fine, but it might be slightly improved:Here: catch (Exception e) { response.setData("Exception occurred");...
View ArticleAnswer by tim for API method to validate Facebook OAuth token
You have a lot of null checks (well, two at least), which I think leads to less readable code. Also, it shouldn't really be necessary to have them.if (authToken == null) this isn't really something...
View ArticleAnswer by Michele d'Amico for API method to validate Facebook OAuth token
Is better to write two private (or protected if you want override in future) methods to get a valid auth token and a valid user.@ApiMethod(name = "getUserData", path = "get_user_data")public Bean...
View ArticleAnswer by TheCoffeeCup for API method to validate Facebook OAuth token
In addition to all the other answers here:This code:} else { user = getUserFromDatabase(authToken); if (user == null) { user = registerUserInDatabase(authToken); userPersonalisedWelcome =...
View Article