helpers

package
v0.0.0-...-cf38ce3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreTokensEqual

func AreTokensEqual(tokenOne string, tokenTwo string) bool

func CheckPassword

func CheckPassword(hashedPass string, inputPass string) bool

func CreateErrorResponse

func CreateErrorResponse(code int, message string) responses.ErrorResponse

func CreateSuccessResponse

func CreateSuccessResponse(code int, message string, data interface{}) responses.SuccessResponse

func CreateUserResponse

func CreateUserResponse(user *models.User) responses.UserResponse

func GenerateHashedPassword

func GenerateHashedPassword(password string) (string, error)

func GenerateToken

func GenerateToken(username string, role string) (string, string, error)

func IsAdmin

func IsAdmin(c *gin.Context) bool

func IsEmpty

func IsEmpty(value string) bool

func IsEqual

func IsEqual(valueOne string, valueTwo string) bool

func IsUser

func IsUser(c *gin.Context) bool

func IsUserMatchesWith

func IsUserMatchesWith(c *gin.Context, inputUsername string) bool

func SetAccessAndRefreshTokenCookies

func SetAccessAndRefreshTokenCookies(c *gin.Context, accessToken, refreshToken string)

func ValidateToken

func ValidateToken(signedToken string) (*authClaims, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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