MCPcopy
hub / github.com/AgentOps-AI/agentops / AuthException

Class AuthException

app/api/agentops/auth/exceptions.py:5–22  ·  view source on GitHub ↗

Shared status_code for all auth exceptions

Source from the content-addressed store, hash-verified

3
4
5class AuthException(HTTPException):
6 """Shared status_code for all auth exceptions"""
7
8 # TODO don't return detailed messages to the client in production
9 def __init__(self, detail: str = "Failed to authenticate user."):
10 super().__init__(status_code=401, detail=detail)
11
12 @classmethod
13 def from_gotrue_autherror(cls, exc: gotrue.errors.AuthApiError):
14 """
15 Create an AuthException from a GoTrue exception.
16
17 This let's us handle explicit messaging to the user and prevents printing
18 all exception messages to the user.
19 """
20 if exc.message == "Email not confirmed":
21 return AuthUnconfirmedEmailException()
22 return cls() # don't bubble messages we don't explicitly approve
23
24
25class AuthUnconfirmedEmailException(AuthException):

Callers 9

_get_sessionMethod · 0.85
_decode_session_cookieFunction · 0.85
auth_codeFunction · 0.85
auth_sessionFunction · 0.85
auth_loginFunction · 0.85
auth_otpFunction · 0.85
auth_oauthFunction · 0.85
auth_signupFunction · 0.85
auth_password_resetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…