auth

package
v0.0.0-...-0eef1dd Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAPI

type AuthAPI struct {
	// contains filtered or unexported fields
}

func NewAuthAPI

func NewAuthAPI(token *authandler.TokenHandler, auth *authandler.AuthHandler, verifycode *authandler.VerifyCodeHandler) *AuthAPI

func (*AuthAPI) Login

func (a *AuthAPI) Login(ctx *gin.Context)

Login @Summary Login @Description login with password, and returns jwt token pair @Tags auth @Accept json @Produce json @Param loginOption body auth.LoginOption true "login params" @Success 200 {object} types.Response{data=auth.TokenResult} @Router /auth/login [POST]

func (*AuthAPI) Refresh

func (a *AuthAPI) Refresh(ctx *gin.Context)

Refresh @Summary Refresh @Description ask for refresh access token lifetime with refresh token @Tags auth @Accept json @Produce json @Param RefreshTokenOption body auth.RefreshTokenOption true "refresh params" @Success 200 {object} types.Response{data=auth.TokenResult} @Router /auth/refresh [POST]

func (*AuthAPI) Register

func (a *AuthAPI) Register(ctx *gin.Context)

Register @Summary Register @Description register a new user with verification code @Tags auth @Accept json @Produce json @Param RegisterOption body auth.RegisterOption true "register params" @Success 200 {object} types.Response @Router /auth/register [POST]

func (*AuthAPI) ResetPassword

func (a *AuthAPI) ResetPassword(ctx *gin.Context)

ResetPassword @Summary ResetPassword @Description reset user password with verification code @Tags auth @Accept json @Produce json @Param ResetPasswordOption body auth.ResetPasswordOption true "reset params" @Success 200 {object} types.Response @Router /auth/reset [POST]

func (*AuthAPI) VerifyCode

func (a *AuthAPI) VerifyCode(ctx *gin.Context)

VerifyCode @Summary VerifyCode @Description send verification code mail to specified email address @Tags auth @Accept json @Produce json @Param VerifyCodeOption body auth.VerifyCodeOption true "VerifyCodeOption" @Success 200 {object} types.Response @Router /auth/code [POST]

type Router

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(group *ginx.RouterGroup, auth *AuthAPI) Router

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳