sign

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MapUserSpace = &sync.Map{} // map[string]*fm.UserSpace, *** record logged-in user space ***
)

Functions

func LogIn

func LogIn(c echo.Context) error

@Title sign in @Summary sign in action. if ok, got token @Description @Tags sign @Accept multipart/form-data @Produce json @Param uname formData string true "user name or email" @Param pwd formData string true "password" Format(password) @Success 200 "OK - sign-in successfully" @Failure 400 "Fail - incorrect password" @Failure 500 "Fail - internal error" @Router /api/sign/in [post]

func NewUser

func NewUser(c echo.Context) error

@Title register a new user @Summary sign up action, step 1. send user's basic info for registry @Description @Tags sign @Accept multipart/form-data @Produce json @Param uname formData string true "unique user name" @Param email formData string true "user's email" Format(email) @Param name formData string true "user's real full name" @Param pwd formData string true "user's password" @Success 200 "OK - then waiting for verification code" @Failure 400 "Fail - invalid registry fields" @Failure 500 "Fail - internal error" @Router /api/sign/new [post]

func ResetPwd

func ResetPwd(c echo.Context) error

@Title reset password @Summary reset password action, step 1. send verification code to user's email for authentication @Description @Tags sign @Accept multipart/form-data @Produce json @Param uname formData string true "unique user name" @Param email formData string true "user's email" Format(email) @Success 200 "OK - then waiting for verification code" @Failure 400 "Fail - invalid registry fields" @Failure 500 "Fail - internal error" @Router /api/sign/reset-pwd [post]

func VerifyEmail

func VerifyEmail(c echo.Context) error

@Title verify new user's email @Summary sign up action, step 2. send back email verification code @Description @Tags sign @Accept multipart/form-data @Produce json @Param uname formData string true "unique user name" @Param code formData string true "verification code (in user's email)" @Success 200 "OK - sign-up successfully" @Failure 400 "Fail - incorrect verification code" @Failure 500 "Fail - internal error" @Router /api/sign/verify-email [post]

func VerifyResetPwd

func VerifyResetPwd(c echo.Context) error

@Title update new password @Summary reset password action, step 2. send back verification code for updating password @Description @Tags sign @Accept multipart/form-data @Produce json @Param uname formData string true "unique user name" @Param code formData string true "verification code (in user's email)" @Param pwd formData string true "new password" @Success 200 "OK - password updated successfully" @Failure 400 "Fail - incorrect verification code" @Failure 500 "Fail - internal error" @Router /api/sign/verify-reset-pwd [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

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