diff --git a/app/src/main/java/com/BugBazaar/controller/UserAuthSave.java b/app/src/main/java/com/BugBazaar/controller/UserAuthSave.java index 425bcbc..e2d6d45 100644 --- a/app/src/main/java/com/BugBazaar/controller/UserAuthSave.java +++ b/app/src/main/java/com/BugBazaar/controller/UserAuthSave.java @@ -47,6 +47,8 @@ public static void savepasscode(int passcode) { editor.apply(); } + + public static String getSavedUsername() { return sharedPreferences.getString(KEY_USERNAME, ""); } diff --git a/app/src/main/java/com/BugBazaar/ui/CreatePasscode.java b/app/src/main/java/com/BugBazaar/ui/CreatePasscode.java index 58fef31..efd6be1 100644 --- a/app/src/main/java/com/BugBazaar/ui/CreatePasscode.java +++ b/app/src/main/java/com/BugBazaar/ui/CreatePasscode.java @@ -10,6 +10,7 @@ import androidx.appcompat.app.AppCompatActivity; +import com.BugBazaar.Models.User; import com.BugBazaar.R; import com.BugBazaar.controller.UserAuthSave; @@ -71,6 +72,8 @@ public void onClick(View view) { UserAuthSave.savepasscode(Integer.parseInt(enteredPasscode)); Toast.makeText(CreatePasscode.this, " New Passcode created!", Toast.LENGTH_SHORT).show(); + CreateSessiontoken(UserAuthSave.getSavedUsername(),UserAuthSave.getpasscode(),UserAuthSave.getpasscode()); + startActivity(new Intent(getApplicationContext(),NavigationDrawer_Dashboard.class)); @@ -78,6 +81,13 @@ public void onClick(View view) { } }); } + + private void CreateSessiontoken(String savedUsername, String getpasscode, String getpasscode1) { + + + + } + //Numpad click handling private View.OnClickListener numpadClickListener = new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java b/app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java index 7b86268..059f7ff 100644 --- a/app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java +++ b/app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java @@ -9,6 +9,7 @@ import android.webkit.WebViewClient; import com.BugBazaar.R; +import com.BugBazaar.controller.UserAuthSave; import com.BugBazaar.utils.AppConstants; import android.widget.TextView; @@ -100,5 +101,17 @@ public String gettoken(){ return String.valueOf(UUID.randomUUID()); } + @android.webkit.JavascriptInterface + public String getusername(){ + + return UserAuthSave.getSavedUsername(); + } + + @android.webkit.JavascriptInterface + public String getpassword(){ + + return UserAuthSave.getSavedPassword(); + } + } } \ No newline at end of file