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] [auth]
# JWT secret # JWT secret
secret = "a key" secret = "a secret"
# Disable registration # Disable registration
disabled = false disabled = false
# bcrypt cost # bcrypt cost

View File

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

View File

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