Fixed incorrect types
This commit is contained in:
parent
ff2b763907
commit
88461ea03d
@ -1,6 +1,6 @@
|
||||
[auth]
|
||||
# JWT secret
|
||||
secret = "a key"
|
||||
secret = "a secret"
|
||||
# Disable registration
|
||||
disabled = false
|
||||
# bcrypt cost
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user