pbs-middleware-server/src/main/java/com/pbs/middleware/server/features/users/rest/UserController.java
/**
     * Returns currently logged in user. This method is used only by form login authentication. The current user
     * is detected from {@link org.springframework.security.core.Authentication} of the current {@link org.springframework.security.core.context.SecurityContextHolder#getContext()}.
     * <p>
     * Spring Security Form-Login implementation forwards the original POST request to this method.
     *
     * @return currently logged in user
     * see com.pbs.middleware.server.common.security.SecurityConfig#webSecurityConfigurerAdapter(SecurityUserDetailsService, SecurityProperties)
     * see SecurityProperties#getLoginSuccessUrl()
     */
Returns currently logged in user. This method is used only by form login authentication. The current user
is detected from  org.springframework.security.core.Authentication of the current  org.springframework.security.core.context.SecurityContextHolder#getContext().

Spring Security Form-Login implementation forwards the original POST request to this method.


Returns currently logged in user . This method is used only by form login authentication . The current user is detected from org . springframework . security . core . Authentication of the current org . springframework . security . core . context . SecurityContextHolder#getContext () . Spring Security Form - Login implementation forwards the original POST request to this method .
@PreAuthorize(ALLOW_AUTHENTICATED)
    @PostMapping(ApiConfig.USERS_ME)
    public User me() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        return mapper.mapToDto(service.getByUsername(((org.springframework.security.core.userdetails.User) authentication.getPrincipal()).getUsername()));
    }
@ PreAuthorize ( ALLOW_AUTHENTICATED ) @ PostMapping ( ApiConfig . USERS_ME ) public User me ( ) { Authentication authentication = SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; return mapper . mapToDto ( service . getByUsername ( ( ( org . springframework . security . core . userdetails . User ) authentication . getPrincipal ( ) ) . getUsername ( ) ) ) ; }
Returns currently logged in user.
Returns currently logged in user .