universal-hashing-sha256

This commit is contained in:
2024-01-04 22:15:22 +03:00
parent 3bd3a52d3b
commit 1f3cb1aab9
5 changed files with 31 additions and 7 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/authorizerdev/authorizer/server/crypto"
"github.com/authorizerdev/authorizer/server/memorystore"
"github.com/gin-gonic/gin"
"golang.org/x/crypto/bcrypt"
)
// CreateAdminAuthToken creates the admin token based on secret key
@@ -31,7 +30,7 @@ func GetAdminAuthToken(gc *gin.Context) (string, error) {
if err != nil {
return "", err
}
err = bcrypt.CompareHashAndPassword([]byte(token), []byte(adminSecret))
err = crypto.VerifyPassword(token, adminSecret)
if err != nil {
return "", fmt.Errorf(`unauthorized`)