Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) bool
- func CreateToken(user *users.User) (*users.LoginResponse, error)
- func DeleteToken(token string, isAccessToken bool) error
- func ExtractSessionUser(token string) (*users.User, error)
- func ExtractToken(ctx context.Context) (string, error)
- func ExtractUser(ctx context.Context) (*users.User, error)
- func HashPassword(password string) (string, error)
- func LoadTokens(token string) (*sessionData, error)
- func SaveTokens(user *users.User, response *users.LoginResponse) error
- func VerifyToken(req string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash will check hashed password against password
func CreateToken ¶
func CreateToken(user *users.User) (*users.LoginResponse, error)
CreateToken will create access and refresh token
func DeleteToken ¶
DeleteToken delete user token
func ExtractToken ¶
ExtractToken try to extract token from context
func ExtractUser ¶
ExtractUser try to extract the current user from the context
func HashPassword ¶
HashPassword return hashed password
func LoadTokens ¶
LoadTokens get tokens by access token
func SaveTokens ¶
func SaveTokens(user *users.User, response *users.LoginResponse) error
SaveTokens save user tokens after login
func VerifyToken ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.