package main

import (
	// External
	"github.com/golang-jwt/jwt/v5"
)

type UserSession struct {
	UserID         int
	Username   string
	Password   string
	Name       string
	ClientUUID string
}

func NewUser(claims jwt.MapClaims) (u UserSession) {
	uid, _ := claims["uid"].(float64)
	name, _ := claims["name"].(string)
	username, _ := claims["login"].(string)
	clientUUID, _ := claims["cid"].(string)

	u.UserID = int(uid)
	u.Username = username
	u.Name = name
	u.ClientUUID = clientUUID
	return
}
