mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
security revamp
This commit is contained in:
@@ -64,6 +64,18 @@ public class UserService {
|
||||
return null;
|
||||
}
|
||||
|
||||
public User login(String apiKey) {
|
||||
if (apiKey == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
User user = userDAO.findByApiKey(apiKey);
|
||||
if (user != null && !user.isDisabled()) {
|
||||
return user;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public User register(String name, String password, String email, Collection<Role> roles) {
|
||||
return register(name, password, email, roles, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user