Add logout function

Issue #51 closed
Brandon Thai created an issue

Add a logout function to the application.

Comments (6)

  1. Raymond Wells

    How's this going?

    By the way, just to help you out.. this is the method you will need to "log the user out".

    Logging the user out is really just destroying the locally stored access token:

    https://bitbucket.org/galacticos/baibai_android_app/src/2e2508c93b5d62648787fd1fd63cee6cfc578f8c/app/src/main/java/com/baibai/androidapp/services/AuthService.java?at=master#cl-19

    And if you want to get fancy, you can also revoke the token using this endpoint:

    POST     /oauth/revoke
    

    Looks like the endpoint expects the token to be passed as POSTDATA: token=accesstokenhere

    You should put the call to that endpoint in the destroyCredentials method in the above link.

  2. Brandon Thai reporter

    I need to do some fixing to the code. currently, when I click logout, I can click the back button and it goes back to the previous page. I need to fix the code to close all activivties.

  3. Log in to comment