Skip to content
Snippets Groups Projects
Commit e422ab7c authored by priagungs's avatar priagungs
Browse files

persist token to sharedpreferences modified

parent 79c69a1c
No related merge requests found
...@@ -106,7 +106,7 @@ public class AuthActivity extends AppCompatActivity { ...@@ -106,7 +106,7 @@ public class AuthActivity extends AppCompatActivity {
User user = ds.getValue(User.class); User user = ds.getValue(User.class);
if (user.getEmail().equals(email) && user.getPassword().equals(md5(password))) { if (user.getEmail().equals(email) && user.getPassword().equals(md5(password))) {
PreferencesHelper.setUserFirebaseId(AuthActivity.this, user.getId()); PreferencesHelper.setUserFirebaseId(AuthActivity.this, user.getId());
PreferencesHelper.setTokenKey(AuthActivity.this, user.getKey()); FirebaseHelper.dbUser.child(PreferencesHelper.getUserFirebaseKey(this)).child("key").setValue(PreferencesHelper.getToken(this));
PreferencesHelper.setUserName(this, user.getName()); PreferencesHelper.setUserName(this, user.getName());
PreferencesHelper.setHasLogin(this, true); PreferencesHelper.setHasLogin(this, true);
finish(); finish();
......
...@@ -81,9 +81,6 @@ public class MainActivity extends AppCompatActivity implements ...@@ -81,9 +81,6 @@ public class MainActivity extends AppCompatActivity implements
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
context = this; context = this;
FirebaseHelper.dbUser.child(PreferencesHelper.getUserFirebaseKey(this)).child("key").setValue(PreferencesHelper.getToken(this));
// Bottom Navigation Bar // Bottom Navigation Bar
bottomNavbar = findViewById(R.id.navigation); bottomNavbar = findViewById(R.id.navigation);
bottomNavbar.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener); bottomNavbar.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment