auth

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckToken

func CheckToken(repo repository.Repository) func(c *gin.Context)

func Login

func Login(repo repository.Repository) func(c *gin.Context)

func RefreshToken

func RefreshToken(repo repository.Repository) func(c *gin.Context)

func Register

func Register(repo repository.Repository) func(c *gin.Context)

Types

type LoginParam

type LoginParam struct {
	Email    string `json:"email" binding:"required,lowercase,email"`
	Password string `json:"password" binding:"required"`
}

type RefreshTokenParam

type RefreshTokenParam struct {
	Token string `json:"token" binding:"required"`
}

type RegisterParam

type RegisterParam struct {
	Name            string `json:"name" binding:"required"`
	Alias           string `json:"alias" binding:"required,lowercase"`
	Email           string `json:"email" binding:"required,lowercase,email"`
	Password        string `json:"password" binding:"required,eqfield=ConfirmPassword"`
	ConfirmPassword string `json:"cpassword" binding:"required"`
}

Jump to

Keyboard shortcuts

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