Start adding token auth
All checks were successful
ci/woodpecker/push/build Pipeline was successful

Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
2026-05-14 19:54:55 +02:00
parent c5af2c7544
commit efe9042bdc
6 changed files with 149 additions and 23 deletions

View File

@@ -4,17 +4,17 @@ import (
"testing"
"gitea.badhouseplants.net/softplayer/softplayer-backend/internal/helpers/hash"
"github.com/alecthomas/assert/v2"
"github.com/stretchr/testify/assert"
)
func TestHashValid(t *testing.T) {
func TestUnitHashValid(t *testing.T) {
password := "qwertyu9"
hpass, err := hash.HashPassword(password, 10)
assert.NoError(t, err)
assert.NoError(t, hash.CheckPasswordHash(password, hpass))
}
func TestHashInvalid(t *testing.T) {
func TestUnitHashInvalid(t *testing.T) {
password := "qwertyu9"
invhash := "qwertyu9"
assert.Error(t, hash.CheckPasswordHash(password, invhash))