Add User Partner and Product

This commit is contained in:
aditya.siregar
2024-06-03 14:40:50 +07:00
parent 67f1dbc850
commit 8a23e72230
46 changed files with 1366 additions and 213 deletions
+7 -7
View File
@@ -44,9 +44,9 @@ func (c *CryptoImpl) ValidateWT(tokenString string) (*jwt.Token, error) {
}
func (c *CryptoImpl) GenerateJWT(user *entity.User) (string, error) {
branchID := int64(0)
partnerID := int64(0)
if user.PartnerID != nil {
branchID = *user.PartnerID
partnerID = *user.PartnerID
}
claims := &entity.JWTAuthClaims{
@@ -56,11 +56,11 @@ func (c *CryptoImpl) GenerateJWT(user *entity.User) (string, error) {
IssuedAt: time.Now().Unix(),
NotBefore: time.Now().Unix(),
},
UserID: user.ID,
Name: user.Name,
Email: user.Email,
Role: int(user.RoleID),
BranchID: branchID,
UserID: user.ID,
Name: user.Name,
Email: user.Email,
Role: int(user.RoleID),
PartnerID: partnerID,
}
token, err := jwt.