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

Logout(): Resting current/sessionToken before throwing exception #30

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ahmedengu
Copy link
Contributor

Greetings,

This prevent sending the old session token with following requests, Also resting the current user prevent unexpected behaviors thus the developer will always expect that the current user is null after calling logout().
This what happens with the js sdk, the user object saved in the local storage is deleted regardless of the response.

Best Regards,
Ahmed

@@ -320,11 +320,11 @@ public void logout() throws ParseException {
ParseCommand command = new ParsePostCommand(ENDPOINT_LOGOUT);
command.addHeader(ParseConstants.HEADER_SESSION_TOKEN, getSessionToken());
ParseResponse response = command.perform();
setSessionToken(null);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahmedengu Why would it make more sense to reset the session and current user before checking whether the action succeeded. In my opinion the original implementation makes more sense i.e. resetting only after a successful deletion

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

Successfully merging this pull request may close these issues.

None yet

2 participants