Tidying up Authenticate activity

This commit is contained in:
Graham Jones
2022-01-26 19:15:52 +00:00
parent bdd7b49358
commit 27a508ce88
3 changed files with 7 additions and 14 deletions

View File

@@ -85,19 +85,6 @@ public class AuthenticateActivity extends AppCompatActivity {
mWac = mConnection.mSdServer.mLm.mWac;
}
//public void authCallback(boolean authSuccess, String tokenStr) {
//Log.v(TAG,"authCallback");
// updateUi();
//}
public void eventCallback(boolean success, String eventStr) {
Log.v(TAG,"eventCallback");
}
public void datapointCallback(boolean success, String datapointStr) {
Log.v(TAG,"datapointCallback");
}
private void updateUi() {
SharedPreferences prefs;
String storedAuthToken;
@@ -146,8 +133,13 @@ public class AuthenticateActivity extends AppCompatActivity {
mWac.authenticate(uname,passwd, (String retVal) -> {
if (retVal != null) {
Log.d(TAG,"Authentication Success - token is "+retVal);
mUtil.showToast("Login Successful");
saveAuthToken(retVal);
updateUi();
} else {
Log.e(TAG,"onOk: Authentication failure for "+uname+", "+passwd);
mUtil.showToast("ERROR: Authentication Failed - Please Try Again");
mUtil.writeToSysLogFile("AuthActivity - Authorisation failed for "+uname+", "+passwd);
}
});
//finish();