@@ -584,48 +584,4 @@ def insert_oauth_session(session_alchemy,
584
584
print (f"State { state } inserted successfully." )
585
585
except Exception as exc :
586
586
print (f"Failed to insert state { state } : { exc } " )
587
- raise exc
588
-
589
-
590
- def change_oauth_session_data (session_alchemy ,
591
- provider : str = None ,
592
- code_verifier : str = None ,
593
- state : str = None ,
594
- expires_at : datetime = None ):
595
- """
596
- Change the session data of an existing OAuth session in the database
597
- for session integrity tests.
598
- """
599
- try :
600
- with DBSession (session_alchemy ) as session :
601
-
602
- oauth_session = session .query (OAuthSession ).filter (
603
- OAuthSession .state == state ).first ()
604
-
605
- if oauth_session :
606
- if provider is not None :
607
- if not isinstance (provider , str ):
608
- raise TypeError (
609
- "The OAuth provider field must be string" )
610
- oauth_session .provider = provider
611
- if code_verifier is not None :
612
- if not isinstance (code_verifier , str ):
613
- raise TypeError (
614
- "The OAuth code_verifier field must be string" )
615
- oauth_session .code_verifier = code_verifier
616
- if state is not None :
617
- if not isinstance (state , str ):
618
- raise TypeError (
619
- "The OAuth state field must be string" )
620
- oauth_session .state = state
621
- if expires_at is not None :
622
- print (f"TYPE OF DATE: { type (expires_at )} " )
623
- if not isinstance (expires_at , datetime .datetime ):
624
- raise TypeError (
625
- "The OAuth expires_at field must be datetime" )
626
- oauth_session .expires_at = expires_at
627
-
628
- session .commit ()
629
- except Exception as exc :
630
- print (f"Failed to update state { state } : { exc } " )
631
- raise exc
587
+ raise exc
0 commit comments