package com.dowstats.service.user

import com.dowstats.data.entities.User
import com.dowstats.data.repositories.UserRepository
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.security.core.context.SecurityContextHolder
import org.springframework.stereotype.Service

@Service
class UserService {
    fun getCurrentUser(): User {
        val sc = SecurityContextHolder.getContext()
        val user = sc.authentication.principal as User
        return user
    }
}
