Fixed incorrect types

This commit is contained in:
perp 2024-06-03 14:51:42 +01:00
parent ff2b763907
commit 88461ea03d
3 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
[auth]
# JWT secret
secret = "a key"
secret = "a secret"
# Disable registration
disabled = false
# bcrypt cost

View File

@ -9,7 +9,7 @@ import (
)
// Encode a token
func Encode(id int) (string, error) {
func Encode(id int64) (string, error) {
// Get time
now := time.Now()

View File

@ -3,15 +3,15 @@ package jwt
import "github.com/golang-jwt/jwt"
// JWT secret
var secret string
var secret []byte
// JWT claims
type Claims struct {
jwt.StandardClaims
ID int `json:"id"` // User ID
ID int64 `json:"id"` // User ID
}
// Set the JWT secret
func New(sec string) {
secret = sec
secret = []byte(sec)
}