-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbc2fc1
commit bbee9c8
Showing
137 changed files
with
1,070 additions
and
929 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
import java.io.Serializable; | ||
|
||
import javax.annotation.PostConstruct; | ||
import jakarta.annotation.PostConstruct; | ||
|
||
import org.apache.log4j.Logger; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
@@ -17,37 +17,37 @@ | |
/** | ||
* Has methods to interact with the authentication system | ||
* | ||
* @since 0.8.0 | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @since 0.8.0 | ||
*/ | ||
@Service | ||
public class AuthenticationBo implements Serializable { | ||
private static final long serialVersionUID = 5427846503367637891L; | ||
|
||
private static final Logger LOGGER = Logger.getLogger(AuthenticationBo.class); | ||
|
||
@Autowired(required = false) | ||
private transient SecurityContextService securityContextService; | ||
|
||
@PostConstruct | ||
public void init() { | ||
if (securityContextService == null) { | ||
securityContextService = new SecurityContextService(); | ||
LOGGER.warn("Had to spawn an entire " + SecurityContextService.class.getName() | ||
+ " because it's not defined as a bean, define a singletone bean for performance and convenience purposes"); | ||
} | ||
} | ||
|
||
/** | ||
* Finds the currently logged in user token | ||
* | ||
* @return | ||
* @since 0.8.0 | ||
* @author Kevin Guanche Darias <[email protected]> | ||
*/ | ||
public TokenUser findTokenUser() { | ||
return securityContextService != null && securityContextService.getAuthentication() != null | ||
? (TokenUser) securityContextService.getAuthentication().getDetails() | ||
: null; | ||
} | ||
private static final long serialVersionUID = 5427846503367637891L; | ||
|
||
private static final Logger LOGGER = Logger.getLogger(AuthenticationBo.class); | ||
|
||
@Autowired(required = false) | ||
private transient SecurityContextService securityContextService; | ||
|
||
@PostConstruct | ||
public void init() { | ||
if (securityContextService == null) { | ||
securityContextService = new SecurityContextService(); | ||
LOGGER.warn("Had to spawn an entire " + SecurityContextService.class.getName() | ||
+ " because it's not defined as a bean, define a singletone bean for performance and convenience purposes"); | ||
} | ||
} | ||
|
||
/** | ||
* Finds the currently logged in user token | ||
* | ||
* @return | ||
* @author Kevin Guanche Darias <[email protected]> | ||
* @since 0.8.0 | ||
*/ | ||
public TokenUser findTokenUser() { | ||
return securityContextService != null && securityContextService.getAuthentication() != null | ||
? (TokenUser) securityContextService.getAuthentication().getDetails() | ||
: null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.