Add User Partner and Product
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user