Skip to content

Commit 2028d03

Browse files
committed
Change logout to also clear Twitter Saved tokens
1 parent 1270158 commit 2028d03

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/AndroidClient/androidchat/src/main/java/servicestack/net/androidchat/App.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ public void saveTwitterAccessToken(TwitterAuthToken authToken){
8989
editor.putString("twitter.AccessTokenSecret", authToken.secret);
9090
editor.apply();
9191
}
92+
93+
public void logout(){
94+
App.get().getServiceClient().clearCookies(); //Logout server
95+
96+
LoginManager.getInstance().logOut(); //Logout facebook
97+
98+
SharedPreferences.Editor editor = prefs.edit(); //Logout twitter
99+
editor.remove("twitter.AccessToken");
100+
editor.remove("twitter.AccessTokenSecret");
101+
editor.apply();
102+
}
103+
92104
public void readBitmap(final String url, final AsyncSuccess<Bitmap> success){
93105
Bitmap cachedBitmap = (Bitmap)bitmapCache.get(url);
94106
if (cachedBitmap != null){

src/AndroidClient/androidchat/src/main/java/servicestack/net/androidchat/MainActivity.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,9 @@ else if (Objects.equals(selector, "logout")){
202202
}
203203

204204
private void performLogout() {
205-
LoginManager.getInstance().logOut();
206-
App.get().getServiceClient().clearCookies();
205+
App.get().logout();
207206
Intent intent = new Intent(getBaseContext(), LoginActivity.class);
208207
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
209-
210208
startActivity(intent);
211209
finish();
212210
}

0 commit comments

Comments
 (0)