service

package
v0.0.0-...-477ec14 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: GPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwtSecret = []byte(os.Getenv("JWT_SECRET_KEY"))

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func GenerateAccessToken

func GenerateAccessToken(id, role string) (string, error)

func GenerateRefreshToken

func GenerateRefreshToken(id string) (string, error)

func HashPassword

func HashPassword(password string) (string, error)

func ValidateToken

func ValidateToken(tokenString string) (*models.Claims, error)

Types

type AuthenticationService

type AuthenticationService struct {
	// contains filtered or unexported fields
}

func NewAuthenticationService

func NewAuthenticationService() *AuthenticationService

func (*AuthenticationService) ActivateUser

func (u *AuthenticationService) ActivateUser(userID *uuid.UUID) error

func (*AuthenticationService) ChangePassword

func (u *AuthenticationService) ChangePassword(user *models.User) error

func (*AuthenticationService) DeactivateUser

func (u *AuthenticationService) DeactivateUser(userID *uuid.UUID) error

func (*AuthenticationService) DeleteUser

func (u *AuthenticationService) DeleteUser(user *models.User) error

func (*AuthenticationService) GetUserById

func (u *AuthenticationService) GetUserById(user *models.User) error

func (*AuthenticationService) GetUserProfile

func (u *AuthenticationService) GetUserProfile(user *models.User) error

func (*AuthenticationService) GetUsers

func (u *AuthenticationService) GetUsers(users *[]models.User) error

func (*AuthenticationService) LoginUser

func (u *AuthenticationService) LoginUser(user *models.User) (string, string, error)

func (*AuthenticationService) Logout

func (u *AuthenticationService) Logout(token string) error

func (*AuthenticationService) PromoteUserToAdmin

func (u *AuthenticationService) PromoteUserToAdmin(userID *uuid.UUID) error

func (*AuthenticationService) RefreshToken

func (u *AuthenticationService) RefreshToken(refreshToken string) (string, error)

func (*AuthenticationService) RegisterUser

func (u *AuthenticationService) RegisterUser(user *models.User) error

func (*AuthenticationService) UpdateUserById

func (u *AuthenticationService) UpdateUserById(user *models.User) error

func (*AuthenticationService) UpdateUserProfile

func (u *AuthenticationService) UpdateUserProfile(user *models.User) error

Jump to

Keyboard shortcuts

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