# Class AuthController | EchoHub Documentation

# Class AuthController

Namespace
  EchoHub.Server.Controllers

Assembly
  EchoHub.Server.dll

    [ApiController]
    [Route("api/auth")]
    [EnableRateLimiting("auth")]
    public class AuthController : ControllerBase

Inheritance
  object
  ControllerBase
  AuthController

Inherited Members
  object.GetType()
  object.MemberwiseClone()
  object.ToString()
  object.Equals(object)
  object.Equals(object, object)
  object.ReferenceEquals(object, object)
  object.GetHashCode()

## Constructors

### AuthController(EchoHubDbContext, JwtTokenService, IUserService)

    public AuthController(EchoHubDbContext db, JwtTokenService jwt, IUserService userService)

#### Parameters

`db` EchoHubDbContext
`jwt` JwtTokenService
`userService` IUserService

## Methods

### Login(LoginRequest)

    [HttpPost("login")]
    public Task<IActionResult> Login(LoginRequest request)

#### Parameters

`request` LoginRequest

#### Returns

Task<IActionResult>

### Logout(RefreshRequest)

    [HttpPost("logout")]
    public Task<IActionResult> Logout(RefreshRequest request)

#### Parameters

`request` RefreshRequest

#### Returns

Task<IActionResult>

### Refresh(RefreshRequest)

    [HttpPost("refresh")]
    public Task<IActionResult> Refresh(RefreshRequest request)

#### Parameters

`request` RefreshRequest

#### Returns

Task<IActionResult>

### Register(RegisterRequest)

    [HttpPost("register")]
    public Task<IActionResult> Register(RegisterRequest request)

#### Parameters

`request` RegisterRequest

#### Returns

Task<IActionResult>