File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ from typing import Protocol , Union
3+
4+ from workos .types .user_management .session import AuthenticateWithSessionCookieSuccessResponse , AuthenticateWithSessionCookieErrorResponse
5+
6+ class SessionModule (Protocol ):
7+
8+ def authenticate (self ) -> Union [AuthenticateWithSessionCookieSuccessResponse , AuthenticateWithSessionCookieErrorResponse ]:
9+ ...
Original file line number Diff line number Diff line change 1+ from typing import List , Optional
2+ from enum import Enum
3+
4+ from workos .types .user_management .impersonator import Impersonator
5+ from workos .types .user_management .user import User
6+ from workos .types .workos_model import WorkOSModel
7+
8+ class AuthenticateWithSessionCookieFailureReason (Enum ):
9+ INVALID_JWT = 'invalid_jwt'
10+ INVALID_SESSION_COOKIE = 'invalid_session_cookie'
11+ NO_SESSION_COOKIE_PROVIDED = 'no_session_cookie_provided'
12+
13+ class AuthenticateWithSessionCookieSuccessResponse (WorkOSModel ):
14+ authenticated : bool = True
15+ sessionId : str
16+ organizationId : Optional [str ] = None
17+ role : Optional [str ] = None
18+ permissions : Optional [List [str ]] = None
19+ user : User
20+ impersonator : Optional [Impersonator ] = None
21+
22+ class AuthenticateWithSessionCookieErrorResponse (WorkOSModel ):
23+ authenticated : bool = False
24+ reason : AuthenticateWithSessionCookieFailureReason
25+
You can’t perform that action at this time.
0 commit comments