Added access checking middleware

Added URLAccessRepository
Refactor
This commit is contained in:
PB
2025-10-22 10:53:20 +02:00
parent 89b665c3d9
commit 662a9b7ffd
11 changed files with 192 additions and 34 deletions

View File

@@ -36,7 +36,7 @@ func NewAuthService(userRepo *domain.UserRepository, cache *redis.Client) *Auth
}
func (a *Auth) Login(login, passwd string) (string, error) {
user, err := a.userRepo.GetByUsername(login)
user, err := a.userRepo.FindByUsername(login)
if err != nil {
// if err = database.NoRowsInQuerySet(err); err != nil {
// return "", errors.New("no user found")
@@ -75,6 +75,11 @@ func (a *Auth) RefreshToken(accessToken string) (string, error) {
return newAccessToken, nil
}
func (a *Auth) VerifyToken(token string) (string, error) {
return token, nil
}
func (a *Auth) Register(email, login, passwd string) (string, error) {
passwd, _ = passSrv.Hash(passwd)