content: package com.urunov.security;
  
  import com.fasterxml.jackson.annotation.JsonIgnore;
  import lombok.AllArgsConstructor;
  import lombok.Getter;
  import lombok.RequiredArgsConstructor;
  import lombok.Setter;
  import org.springframework.security.core.GrantedAuthority;
  import org.springframework.security.core.userdetails.UserDetails;
  
  import java.util.Collection;
  
  /**
   * Created by:
   * User: hamdamboy
   * Project: IntelliJ IDEA
   * Github: @urunov
   */
  @Getter
  @Setter
  @RequiredArgsConstructor
  @AllArgsConstructor
  public class UserPrincipal implements UserDetails {
  
      private Long id;
  
      private String surname;
      private String name;
  
      private String lastname;
      private String username;
  
      private String city;
  
      @JsonIgnore
      private String email;
  
      @JsonIgnore
      private String password;
  
      private Collection<? extends GrantedAuthority> authorities;
  
      @Override
      public Collection<? extends GrantedAuthority> getAuthorities() {
          return null;
      }
  
      @Override
      public String getPassword() {
          return password;
      }
  
      @Override
      public String getUsername() {
          return username;
      }
  
      @Override
      public boolean isAccountNonExpired() {
          return true;
      }
  
      @Override
      public boolean isAccountNonLocked() {
          return true;
      }
  
      @Override
      public boolean isCredentialsNonExpired() {
          return false;
      }
  
      @Override
      public boolean isEnabled() {
          return true;
      }
  
      @Override
      public int hashCode() {
          return super.hashCode();
      }
  
      @Override
      public boolean equals(Object obj) {
          return super.equals(obj);
      }
  }
  