package com.betriebsratkanzlei.legalconsenthub.security

import org.springframework.security.core.GrantedAuthority
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken
import org.springframework.security.oauth2.jwt.Jwt

class CustomJwtAuthentication(
    jwt: Jwt,
    private val principal: CustomJwtTokenPrincipal,
    authorities: Collection<GrantedAuthority>
) : JwtAuthenticationToken(
    jwt, authorities, principal.id
) {
    override fun getPrincipal(): CustomJwtTokenPrincipal {
        return principal
    }
}
