Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrInvalidParameters = iota ErrInvalidCredentials ErrMissingToken ErrInvalidToken ErrDecryptionToken ErrInsufficientRights )
Variables ¶
View Source
var ( JwtSecret = []byte("upersecretpass") TokenExpiration = 60 * time.Minute )
Functions ¶
func NewToken ¶
func NewToken(entity entities.TokenClaimer) (string, error)
NewToken return new token for given employee.
func ParseToken ¶
func ParseToken(authenticate string) (entities.TokenClaims, error)
ParseToken parses given token and returns token claims with embedded JWT claims if token is valid.
func ValidPassword ¶
ValidPassword verifies given password with hashed one.
Types ¶
type AuthError ¶
type AuthError struct { Reason AuthErrorReason Err error }
type AuthErrorReason ¶
type AuthErrorReason int
Click to show internal directories.
Click to hide internal directories.