Skip to content

Commit

Permalink
Merge pull request #6 from hotosm/fix/pydantic-validation-error
Browse files Browse the repository at this point in the history
Replace Pydantic ValueError with standard ValueError
  • Loading branch information
spwoodcock authored Apr 10, 2024
2 parents dcb5467 + 19c3c06 commit c35f5a5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions osm_login_python/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from itsdangerous import BadSignature, SignatureExpired
from itsdangerous.url_safe import URLSafeSerializer
from pydantic import ValidationError
from requests_oauthlib import OAuth2Session

from . import Login, Token
Expand Down Expand Up @@ -103,6 +102,6 @@ def deserialize_access_token(self, access_token: str) -> dict:
user_data = deserializer.loads(decoded_token)
except (SignatureExpired, BadSignature) as e:
log.error(e)
raise ValidationError("Invalid token") from e
raise ValueError("Auth token is invalid or expired") from e

return user_data

0 comments on commit c35f5a5

Please sign in to comment.