Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support API Error Login Callbacks #38

Open
mohamedmansour opened this issue Aug 17, 2012 · 3 comments
Open

Support API Error Login Callbacks #38

mohamedmansour opened this issue Aug 17, 2012 · 3 comments
Assignees

Comments

@mohamedmansour
Copy link
Owner

When a user isn't logged on, we need a callback from the API to handle when the user logged on Google+ and when they are not logged (authed).

Perhaps we should create the endoint such as.

plus.setAuthCallback(function(state) {
   console.log('State changed', state.isAuthed);
});
@ghost ghost assigned mohamedmansour and tzafrir Aug 17, 2012
@mohamedmansour
Copy link
Owner Author

The way we are getting the authed user is failing now since the Auth Session is always valid now.

@tzafrir
Copy link
Collaborator

tzafrir commented Aug 17, 2012

Sounds good.

Can you explain what's currently happening? What do you mean by Auth session is always valid?

@mohamedmansour
Copy link
Owner Author

Try logging out and initialize JSAPI, will it return failure?
Now try logging in a Google Account which doesn't have a Google+ account, will it return failure?

When we initalized the JSAPI and then we logged out, the API will return a single row map with a null which means (afaik) your not authed. What we should do, for every API caller, we need to validate the response and produce a fail callback if that happens.

To make developers life easier, perhaps we can have a callback that shows the state of auth, because some extensions would like to:

  • Change the badge to an error badge if auth is failing.
  • Show an HTML5 notification if an auth is not working
  • Or show some custom UI for errors.

Something developers can hook into to catch failures. to manage a global state.

I just want to catch errors where the user is requesting an API call which they don't have access to (due to multiple login issue where their primary account isn't their Google+ account), or if they are logged out after. The getSession seems flaky.

I will see what the issue is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants