package gaf3.core.services.auth

import gaf3.core.services.auth.domain.AuthToken
import gaf3.core.services.auth.domain.LoginForm
import gaf3.core.services.auth.service.GafAuthService
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RestController
import javax.validation.Valid

@RestController
class GafAuthServiceController(val service: GafAuthService) {

    @PostMapping(path = ["/gaf/auth/login"])
    fun login(@RequestBody @Valid form: LoginForm): AuthToken{
        return service.login(form)
    }

}
