Authenticated user information.
| 35 | |
| 36 | |
| 37 | class AuthUser: |
| 38 | """Authenticated user information.""" |
| 39 | |
| 40 | def __init__(self, user_id: str, email: Optional[str], phone: Optional[str], is_anonymous: bool = False): |
| 41 | self.id = user_id |
| 42 | self.email = email |
| 43 | self.phone = phone |
| 44 | self.is_anonymous = is_anonymous |
| 45 | |
| 46 | @property |
| 47 | def identifier(self) -> str: |
| 48 | """Get user identifier (email or user_id).""" |
| 49 | return self.email or self.id |
| 50 | |
| 51 | |
| 52 | async def get_current_user(authorization: Optional[str] = Header(None)) -> AuthUser: |
no outgoing calls