auth

package
v0.0.0-...-aebebc0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRoutes

func CreateRoutes(e *echo.Echo)

func EncodeUserTokenJwt

func EncodeUserTokenJwt(id string, username string, isAdmin bool) (string, error)

Types

type JWTClaims

type JWTClaims struct {
	Id       string `json:"id"`
	Username string `json:"username"`
	IsAdmin  bool   `json:"is_admin"`
	jwt.RegisteredClaims
}

func DecodeUserTokenJwt

func DecodeUserTokenJwt(tokenString string) (*JWTClaims, error)

type LoginDTO

type LoginDTO struct {
	Username string `json:"username" validate:"required"`
	Password string `json:"password" validate:"required"`
}

type LoginResponse

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

type RegisterDTO

type RegisterDTO struct {
	Username string `json:"username" validate:"required"`
	Password string `json:"password" validate:"required"`
}

type RegisterResponse

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

Jump to

Keyboard shortcuts

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