Versions in this module Expand all Collapse all v0 v0.0.1 Nov 3, 2024 Changes in this version + const CancelRequestKey + func Assert(condition bool, message string) + func CancelRequest(r *http.Request) error + func DecodeAndComparePasswords(plainTextPassword string, encodedPassword string, encodedSalt string, ...) (bool, error) + func DecodeJwt(rawToken string) (string, error) + func GenerateAuthCookie(userId int) (*http.Cookie, error) + func GenerateEncodedSaltAndPasswordHash(password string, config AuthConfig) (encodedPassword string, encodedSalt string, err error) + func GenerateJwt(userId string) (string, error) + func GeneratePasswordHash(password string, salt []byte, config AuthConfig) []byte + func GenerateSalt(length int32) ([]byte, error) + func GetFunctionName(function any) string + func ReadEnv() + type AuthConfig struct + KeyLen uint32 + Memory uint32 + SaltLen int32 + Threads uint8 + Time uint32 + type UserJwt struct + ExpiresAt string + UserId string