Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func NewAuthHandler ¶
func NewAuthHandler(authUseCase _authUseCase.AuthUseCaseInterface) *AuthHandler
func (*AuthHandler) LoginHandler ¶
func (ah *AuthHandler) LoginHandler(c echo.Context) error
Login handler @Summary Login @Description Log in a user with email and password @Tags auth @ID auth-login @Accept json @Produce json @Param data body _authUseCase.LoginDTORequest true "Login Data" @Success 200 {object} _authUseCase.AuthResponse @Failure 400 {object} helper.ResponseFailedBody "User failed to login" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Router /login [post]
func (*AuthHandler) LogoutHandler ¶
func (ah *AuthHandler) LogoutHandler(c echo.Context) error
Logout handler @Summary Logout @Description Logout a user by token @Tags auth @ID auth-logout @Accept json @Produce json @Success 200 {object} helper.ResponseSuccessBody "Logout successfuly" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Security ApiKeyAuth @Router /logout [post]
func (*AuthHandler) MeHandler ¶
func (ah *AuthHandler) MeHandler(c echo.Context) error
GetMe @Summary Me @Description Get user data by token @Tags auth @ID auth-me @Accept json @Produce json @Success 200 {object} helper.UserResponse @Failure 400 {object} helper.ResponseFailedBody "Server Error" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Security ApiKeyAuth @Router /me [get]
func (*AuthHandler) RegisterHandler ¶
func (ah *AuthHandler) RegisterHandler(c echo.Context) error
Register handler @Summary Register @Description Register a user with email and password and return JWT token @Tags auth @ID auth-register @Accept json @Produce json @Param data body _authUseCase.RegisterDTORequest true "Register Data" @Success 200 {object} _authUseCase.AuthResponse @Failure 400 {object} helper.ResponseFailedBody "User failed to login" @Failure 500 {object} helper.ResponseFailedBody "Server Error" @Router /register [post]