Skip to content

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

Open
ahmedengu wants to merge 1 commit intosidiabale:developfrom
ahmedengu:master
Open

Logout(): Resting current/sessionToken before throwing exception#30
ahmedengu wants to merge 1 commit intosidiabale:developfrom
ahmedengu:master

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

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.

2 participants