Skip to content

Commit

Permalink
Merge pull request #414 from DagsHub/bug/add-empty-token
Browse files Browse the repository at this point in the history
Raise a better error on adding empty token
  • Loading branch information
kbolashev authored Jan 7, 2024
2 parents 66041e8 + 2c099f6 commit eae013f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dagshub/auth/token_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ class HTTPBearerAuth(Auth):
"""Attaches HTTP Bearer Authorization to the given Request object."""

def __init__(self, token):
if token == "":
raise ValueError("token can't be empty")
self.token = token

def auth_flow(self, request: Request) -> Generator[Request, Response, None]:
Expand Down

0 comments on commit eae013f

Please sign in to comment.