content: package co.airy.spring.auth.session;
  
  import lombok.NoArgsConstructor;
  import org.springframework.security.core.Authentication;
  import org.springframework.security.core.GrantedAuthority;
  
  import java.io.Serializable;
  import java.util.Collection;
  
  @NoArgsConstructor
  public class UserAuth implements Authentication, Serializable {
      private UserProfile userProfile;
      private boolean isAuthenticated = true;
  
      public UserAuth(UserProfile userProfile) {
          this.userProfile = userProfile;
      }
  
      @Override
      public Collection<? extends GrantedAuthority> getAuthorities() {
          return null;
      }
  
      @Override
      public Object getCredentials() {
          return null;
      }
  
      @Override
      public Object getDetails() {
          return null;
      }
  
      @Override
      public UserProfile getPrincipal() {
          return userProfile;
      }
  
      @Override
      public boolean isAuthenticated() {
          return this.isAuthenticated;
      }
  
      @Override
      public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
          this.isAuthenticated = true;
      }
  
      @Override
      public String getName() {
          return userProfile.getId();
      }
  }
  