handler

package
v0.0.0-...-93b1a64 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	Register(context echo.Context) error
	Login(context echo.Context) error
	Refresh(context echo.Context) error
}

func NewAuthHandler

func NewAuthHandler(service service.Auth) Auth

type DefaultHttpError

type DefaultHttpError struct {
	Message string `json:"message"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email" validate:"required,email"`
	Password string `json:"password" validate:"required,min=8,max=30"`
}

type LoginResponse

type LoginResponse struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
}

type RefreshRequest

type RefreshRequest struct {
	RefreshToken string `json:"refreshToken"`
}

type RefreshResponse

type RefreshResponse struct {
	AccessToken string `json:"accessToken"`
}

type RegisterRequest

type RegisterRequest struct {
	FirstName string `json:"firstName" validate:"required,min=2,max=20"`
	LastName  string `json:"lastName" validate:"required,min=2,max=20"`
	Email     string `json:"email" validate:"required,email"`
	Password  string `json:"password" validate:"required,min=8,max=30"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL