start working on the frontend side

This commit is contained in:
Warp Agent
2025-12-24 19:53:45 +00:00
parent 3aa0169af0
commit c962a223c6
84 changed files with 14761 additions and 58 deletions

View File

@@ -0,0 +1,20 @@
package auth
import (
"crypto/sha256"
"encoding/hex"
)
// HashToken creates a cryptographic hash of the token for storage
// Uses SHA-256 to hash the token before storing in the database
func HashToken(token string) string {
hash := sha256.Sum256([]byte(token))
return hex.EncodeToString(hash[:])
}
// VerifyTokenHash verifies if a token matches a stored hash
func VerifyTokenHash(token, storedHash string) bool {
computedHash := HashToken(token)
return computedHash == storedHash
}