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 API #315

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Logout API #315

merged 1 commit into from
Sep 12, 2024

Conversation

mohssenfathi
Copy link
Contributor

Description

Adding a new top-level API to UberAuth to "logout" the current user. This function deletes the stored auth token by:

  1. If UberAuth has a stored currentContext, calls the logout API on the currentContext
  2. If UberAuth does not have a stored currentContext, uses an internal TokenManager instance and deletes the token saved under the default identifier.

The equivalent API has been added to AuthorizationCodeAuthProvider to delete the token as described in (2).

After token deletion, UberAuth will release the stored currentContext.

Another computed property isLoggedIn was added for convenience to determine if a token exists in the keychain.

Changes

UberAuth API

Added new static and instance methods to UberAuth for logout as described above. Added computed isLoggedIn property to determine auth state.

AuthorizationCodeAuthProvider API

Added methods to AuthorizationCodeAuthProvider to delete the token for logout. Added computed isLoggedIn property to determine auth state.

Testing

Unit Tests

Added unit tests to ensure tokens are deleted and currentContext released properly

Manual Testing

Updated the UberSDK sample app to use the new APIs for manual testing.

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-09-10.at.11.18.10.mp4

@mohssenfathi mohssenfathi marked this pull request as ready for review September 10, 2024 20:00
@mohssenfathi mohssenfathi merged commit 6dec2b6 into uber:2.x Sep 12, 2024
4 checks passed
@mohssenfathi mohssenfathi deleted the logout branch September 12, 2024 15:47
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