All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dream.utils.SecurityHelper Maven / Gradle / Ivy

package com.dream.utils;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;


public class SecurityHelper {

    public static boolean isLogged() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (authentication != null && authentication.getPrincipal() instanceof User) {
            return authentication.isAuthenticated();
        }
        return false;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy