diff --git a/api/blueprints/mail/oauth_callback.py b/api/blueprints/mail/oauth_callback.py index eef0e37..1d8f23b 100644 --- a/api/blueprints/mail/oauth_callback.py +++ b/api/blueprints/mail/oauth_callback.py @@ -167,7 +167,6 @@ async def mail_callback( db_conn = current_app.sql_writer, mongo_conn = current_app.data_mongo, session_token = inbound_headers.get("X-Session-Token"), - user_info = kwargs["session_info"], user_identifier = inbound_data["state"], token = tokens.model_dump() ) diff --git a/models/behaviour/mail/oauth.py b/models/behaviour/mail/oauth.py index b30fcff..dc5d481 100644 --- a/models/behaviour/mail/oauth.py +++ b/models/behaviour/mail/oauth.py @@ -134,14 +134,14 @@ class MailOAuthModel(BaseModel): }, update = { "$set": { - "lastRequestTs": request_ts + "lastRequestTs": request_ts, + "user": user_info, }, "$setOnInsert": { "version": "1.0.0", "serviceType": service_type, "client": service_client, "authType": auth_type, - "user": user_info, "token": None, "firstRefreshTs": None, "lastRefreshTs": None, @@ -182,7 +182,6 @@ class MailOAuthModel(BaseModel): self, db_conn: AsyncMySQL, mongo_conn: AsyncMongo, - user_info: dict, user_identifier: ObjectId | str, token: dict, session_token: str = None @@ -227,15 +226,15 @@ class MailOAuthModel(BaseModel): db_conn = db_conn, proc_name = "entity_integration_save", proc_args = ( - user_info["entityId"], # ... 'p_entity_id' - mongo_json["client"], # .... 'p_provider' - "Auth Granted", # .......... 'p_current_status' - "Set Token", # ............. 'p_last_action' - None, # .................... 'p_display_name' - None, # .................... 'p_display_picture' - user_identifier, # ......... 'p_token_id' - token["email"], # .......... 'p_notes' - user_info["userId"] # ...... 'p_created_by' + mongo_json["user"]["entityId"], # ... 'p_entity_id' + mongo_json["client"], # ............. 'p_provider' + "Auth Granted", # ................... 'p_current_status' + "Set Token", # ...................... 'p_last_action' + None, # ............................. 'p_display_name' + None, # ............................. 'p_display_picture' + user_identifier, # .................. 'p_token_id' + token["email"], # ................... 'p_notes' + mongo_json["user"]["userId"] # ...... 'p_created_by' ), session_token = session_token )