Add callback and update user role

This commit is contained in:
aditya.siregar
2024-06-05 00:24:53 +07:00
parent 4d402e32c9
commit 04a89c5508
27 changed files with 388 additions and 49 deletions
+6
View File
@@ -51,6 +51,11 @@ func (c *CryptoImpl) GenerateJWT(user *entity.User) (string, error) {
partnerID = *user.PartnerID
}
siteID := int64(0)
if user.SiteID != nil {
siteID = *user.SiteID
}
claims := &entity.JWTAuthClaims{
StandardClaims: jwt.StandardClaims{
Subject: strconv.FormatInt(user.ID, 10),
@@ -63,6 +68,7 @@ func (c *CryptoImpl) GenerateJWT(user *entity.User) (string, error) {
Email: user.Email,
Role: int(user.RoleID),
PartnerID: partnerID,
SiteID: siteID,
}
token, err := jwt.