Skip to content

Commit

Permalink
Merge pull request #60 from Omnipro-Solutions/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
edgarpena14 committed May 24, 2024
2 parents 5f85273 + 741e774 commit 120e50d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions omni_pro_oms/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ def has_permission(self, request, view):
response = requests.get(url, headers=headers)
return response.status_code == 200

token = request.headers.get("token", None)
if token:
url = settings.AUTH_BASE_URL + "/auth/user/validate/"
headers = {"Authorization": f"Token {token}"}
response = requests.get(url, headers=headers)
return response.status_code == 200

return False

0 comments on commit 120e50d

Please sign in to comment.