Skip to content

Commit

Permalink
Merge pull request #69 from payatu/vedant
Browse files Browse the repository at this point in the history
added fixes
  • Loading branch information
banditAmit authored Jul 28, 2024
2 parents c3e3c65 + 1e43f1c commit 8ad9b89
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/src/main/java/com/BugBazaar/controller/UserAuthSave.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ public class UserAuthSave {
private static final String KEY_USERNAME = "username";
private static final String KEY_PASSWORD = "password";
private static final String keypasscode = "passcode";
private static final String USER_DATA = "userCred";
private static SharedPreferences sharedPreferences1;

private static final String keypasscode_flag = "passcode_flag";
private static final String USER_DATA = "userCred";

private static SharedPreferences sharedPreferences;
private SessionManager sessionManager; // Move the initialization to a constructor
private static SharedPreferences sharedPreferences1;

public UserAuthSave(Context context) {
public UserAuthSave(Context context) {
sharedPreferences = context.getSharedPreferences(USER_PREFERENCES, Context.MODE_PRIVATE);
sessionManager = new SessionManager(context); // Initialize SessionManager in the constructor
sharedPreferences1 = context.getSharedPreferences(USER_DATA, Context.MODE_PRIVATE);
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/BugBazaar/ui/Signin.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ public void onClick(View v) {
boolean isLoggedin= loginController.validateLogin(username, password);

if (isLoggedin==true) {

String randomToken = TokenGenerator.generateRandomToken(64);
sessionManager.setLoggedIn(true);
userAuthSave.saveUserData( randomToken,isLoggedin);
userAuthSave.saveuserCred(username,password);
sessionManager.setLoggedIn(true);
String randomToken = TokenGenerator.generateRandomToken(64);
userAuthSave.saveUserData( randomToken,isLoggedin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

public class TermsAndConditionsActivity extends AppCompatActivity {
WebView webView;
private SessionManager sessionManager;

private String webViewUrl;

Expand Down Expand Up @@ -77,7 +78,7 @@ else if (webViewUrl.endsWith(".bugbazaar.com")){
}

private String getsessionid() {
return String.valueOf(UUID.randomUUID());
return sessionManager.getUserToken();
}

private class JavaScriptInterface {
Expand Down

0 comments on commit 8ad9b89

Please sign in to comment.