Skip to content

Commit

Permalink
Fix: non final role and setmethod, also authtoken changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianBalunan committed Apr 22, 2026
1 parent ef3b1bf commit 3d48338
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class User {
private String username;
private String email;
private String passwordHash;
private final Role role;
private Role role;
private Settings settings;
private Inbox inbox;

Expand Down Expand Up @@ -200,4 +200,12 @@ public void setInbox(Inbox inbox) {
}
this.inbox = inbox;
}

public void setRole(Role role) {
if (role == null) {
throw new IllegalArgumentException("Inbox cannot be null");
}
this.role = role;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public boolean login(String email, String password){
if (user != null){
currentUser = user;
isCharityUser = userDataReader.getUserCharityUser(currentUser.getId().toString());
if (isCharityUser != null){
currentUser.setRole(Role.CHARITY_USER);
}
System.out.println("User gotten");
return true;
}
Expand Down

0 comments on commit 3d48338

Please sign in to comment.