working sub
This commit is contained in:
@@ -7,13 +7,14 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
)
|
||||
|
||||
func encodeURL(user User) string {
|
||||
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
||||
"id": user.ID, "name": user.Username, "pass": user.Password,
|
||||
"id": user.ID, "name": user.Username, "pass": user.Password, "iat": time.Now().Unix(),
|
||||
})
|
||||
tokenString, err := token.SignedString([]byte(os.Getenv("JWT_SECRET")))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user