removed 'internal' directory

This commit is contained in:
Bronku 2025-06-19 21:48:06 +02:00
parent 8c200a5a6c
commit 65709049d7
42 changed files with 35 additions and 44 deletions

19
auth/credentials.go Normal file
View file

@ -0,0 +1,19 @@
package auth
import (
"errors"
"github.com/Bronku/iroon/crypto"
)
func (a *Authenticator) verifyCredentials(login, password string) error {
user, ok := a.s.GetUser(login)
if !ok {
return errors.New("user with this login doesn't exist")
}
hash := crypto.PasswordHash(password, user.Salt)
if hash == user.Password {
return nil
}
return errors.New("wrong credentials")
}