auth

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(user models.Users) error

CheckPassword removes salt from the provided password and verifies its hash. Internally it uses a special library github.com/JammUtkarsh/cypherDecipher, to remove salt from the password.

func GenerateJWT

func GenerateJWT(username string) (tokenString string, err error)

GenerateJWT takes username as parameter and returns a JWT string and error if any.

func HashPassword

func HashPassword(user models.Users) (password string, err error)

HashPassword removes the salt from the provided password returns the hashed version of it. Internally it uses a special library github.com/JammUtkarsh/cypherDecipher, to remove salt from the password.

func ValidateToken

func ValidateToken(signedToken string) (err error)

ValidateToken takes JWT string as a parameter and verifies it. Returns an error if invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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