get holidays from external service
This commit is contained in:
19
src/main/java/de/mbremer/secutity/UserService.java
Normal file
19
src/main/java/de/mbremer/secutity/UserService.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package de.mbremer.secutity;
|
||||
|
||||
import io.quarkus.security.identity.SecurityIdentity;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
|
||||
@RequestScoped
|
||||
public class UserService {
|
||||
@Inject
|
||||
SecurityIdentity identity;
|
||||
|
||||
/**
|
||||
* Returns the user currently logged in.
|
||||
*/
|
||||
public User getCurrentUser() {
|
||||
return User.find("username", identity.getPrincipal().getName()).singleResult();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user