This repository was archived by the owner on Jul 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed
app/src/main/java/com/zulip/android Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -381,11 +381,11 @@ public void useDefaultServerURL() {
381
381
setServerURL (DEFAULT_SERVER_URL );
382
382
}
383
383
384
- public void setLoggedInApiKey (String apiKey ) {
384
+ public void setLoggedInApiKey (String apiKey , String email ) {
385
385
this .api_key = apiKey ;
386
386
Editor ed = this .settings .edit ();
387
- ed .putString (EMAIL , this . getEmail () );
388
- ed .putString (API_KEY , api_key );
387
+ ed .putString (EMAIL , email );
388
+ ed .putString (API_KEY , apiKey );
389
389
ed .apply ();
390
390
afterLogin ();
391
391
}
Original file line number Diff line number Diff line change @@ -61,15 +61,12 @@ protected void onCreate(Bundle savedInstanceState) {
61
61
authEmailAdapter .setOnItemClickListener (new AuthClickListener () {
62
62
@ Override
63
63
public void onItemClick (String email ) {
64
- if (email .contains ("@" )) {
65
- getApp ().setEmail (email );
66
- }
67
64
getServices ()
68
65
.loginDEV (email )
69
66
.enqueue (new DefaultCallback <LoginResponse >() {
70
67
@ Override
71
68
public void onSuccess (Call <LoginResponse > call , Response <LoginResponse > response ) {
72
- getApp ().setLoggedInApiKey (response .body ().getApiKey ());
69
+ getApp ().setLoggedInApiKey (response .body ().getApiKey (), response . body (). getEmail () );
73
70
openHome ();
74
71
}
75
72
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ private void handleSignInResult(final GoogleSignInResult result) {
275
275
@ Override
276
276
public void onSuccess (Call <LoginResponse > call , Response <LoginResponse > response ) {
277
277
connectionProgressDialog .dismiss ();
278
- getApp ().setEmail ( response .body ().getEmail ());
278
+ getApp ().setLoggedInApiKey ( response . body (). getApiKey (), response .body ().getEmail ());
279
279
openHome ();
280
280
}
281
281
@@ -372,15 +372,14 @@ public void onClick(View v) {
372
372
connectionProgressDialog .show ();
373
373
String username = mUserName .getText ().toString ();
374
374
String password = mPassword .getText ().toString ();
375
- getApp ().setEmail (username );
376
375
getServices ()
377
376
.login (username , password )
378
377
.enqueue (new DefaultCallback <LoginResponse >() {
379
378
380
379
@ Override
381
380
public void onSuccess (Call <LoginResponse > call , Response <LoginResponse > response ) {
382
381
connectionProgressDialog .dismiss ();
383
- getApp ().setLoggedInApiKey (response .body ().getApiKey ());
382
+ getApp ().setLoggedInApiKey (response .body ().getApiKey (), response . body (). getEmail () );
384
383
openHome ();
385
384
}
386
385
You can’t perform that action at this time.
0 commit comments