Skip to content

Commit

Permalink
fix: role
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jun 30, 2024
1 parent cdc87ee commit 6903fa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/token/token.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ func (s *serviceImpl) ValidateToken(token string) (*dto.UserCredentials, error)
return nil, fmt.Errorf("user_id not found in payloads")
}

role, ok := payloads["role"].(constant.Role)
role, ok := payloads["role"]
if !ok {
s.log.Named("ValidateToken").Error("role not found in payloads")
return nil, fmt.Errorf("role not found in payloads")
}

return &dto.UserCredentials{
UserID: userId,
Role: role,
Role: constant.Role(role.(string)),
}, nil

}
Expand Down

0 comments on commit 6903fa4

Please sign in to comment.