auth

package
v0.0.0-...-f47b430 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenIsBlocked  = fmt.Errorf("token is blocked")
	ErrTokenIsNotValid = fmt.Errorf("token is not valid")
)

Functions

func Login

func Login(ctx *fiber.Ctx) error

Login create access token and refresh token for a valid user HealthCheck godoc @Summary Login a user. @Description logs in a user if valid credentials given. @Tags auth @Param data body structs.UserLoginRequest true "data" @Accept application/json @Produce json @Success 200 {object} UserLoginResponse @Router /auth/login [post]

func RenewToken

func RenewToken(ctx *fiber.Ctx) error

RenewToken renews the access token using a valid refresh token HealthCheck godoc @Summary Renew the access token @Description Renew the access token using the refresh token @Tags auth @Param username path string true "username" @Param refresh-token query string true "refresh token" minlength(1) @Accept application/json @Produce json @Success 200 {object} map[string]interface{} @Router /auth/renew-token [get]

func SignUp

func SignUp(ctx *fiber.Ctx) error

SignUp signs up a user HealthCheck godoc @Summary SignUp a user. @Description create an account for a user. @Tags auth @Param data body structs.UserRegisterRequest true "data" @Accept application/json @Produce json @Success 200 {object} map[string]interface{} @Router /auth/signup [post]

func VerifyEmail

func VerifyEmail(ctx *fiber.Ctx) error

VerifyEmail verifies email of a valid user HealthCheck godoc @Summary Verify email address. @Description Verify email address. @Tags auth @Param id path string true "token ID" @Param token path string true "token" @Accept application/json @Produce json @Success 200 {object} map[string]interface{} @Router /auth/verify-email/{id}/{token} [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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