Newer
Older
bremer / src / main / kotlin / model / BremerUser.kt
yhornisse on 6 Aug 2023 754 bytes refactor and add tag
/*
 * Copyright (c) 2023. yo-saito. All Rights Reserved.
 */

package net.piedpiper.bremer.model

import net.piedpiper.bremer.entity.UserEntity
import org.springframework.security.core.GrantedAuthority
import org.springframework.security.core.userdetails.UserDetails

class BremerUser(
    private val user: UserEntity
) : UserDetails {
    override fun getAuthorities(): MutableCollection<out GrantedAuthority> = mutableListOf()
    override fun getUsername(): String = user.accountId
    override fun getPassword(): String = user.secret
    override fun isAccountNonExpired(): Boolean = true
    override fun isAccountNonLocked(): Boolean = true
    override fun isCredentialsNonExpired(): Boolean = true
    override fun isEnabled(): Boolean = true
}