File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
app/bss/adapters/portaswitch Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -249,11 +249,16 @@ def validate_session(self, access_token: str) -> SessionInfo:
249249 try :
250250 self ._account_api .decode_and_verify_access_token_expiration (access_token )
251251 session_data : dict = self ._account_api .ping (access_token = access_token )
252+ user_id = session_data ["user_id" ]
252253
253- return SessionInfo (
254- user_id = session_data ["user_id" ],
255- access_token = access_token ,
256- )
254+ if not user_id :
255+ raise WebTritErrorException (
256+ status_code = 401 ,
257+ error_message = "Access token invalid" ,
258+ code = "access_token_invalid" ,
259+ )
260+
261+ return SessionInfo (user_id = user_id , access_token = access_token )
257262 except ExpiredSignatureError :
258263 raise WebTritErrorException (
259264 status_code = 401 ,
You can’t perform that action at this time.
0 commit comments