(20241129) Started talking to MariaDB for integration.
This commit is contained in:
@@ -163,8 +163,11 @@ async def mail_callback(
|
||||
tokens.email = user_profile.data["emailAddress"] if user_profile.success else None
|
||||
|
||||
# Save the tokens to the database
|
||||
tokens_saved = await MailOAuthModel.set_token(
|
||||
db_conn = current_app.data_mongo,
|
||||
tokens_saved = await current_app.mail_oauth_model.set_token(
|
||||
db_conn = current_app.sql_writer,
|
||||
mongo_conn = current_app.data_mongo,
|
||||
session_token = inbound_headers["X-Session-Token"],
|
||||
user_info = kwargs["session_info"],
|
||||
user_identifier = inbound_data["state"],
|
||||
token = tokens.model_dump()
|
||||
)
|
||||
@@ -174,7 +177,7 @@ async def mail_callback(
|
||||
# ┛┗┗ ┛┣┛┗┛┛┗┛┗
|
||||
# ┛
|
||||
|
||||
# # Return a response:
|
||||
# # Return a JSON response:
|
||||
# return ResponseModel(
|
||||
# status_code = StatusCodes.OK if tokens_saved else StatusCodes.FAILED,
|
||||
# http_code = HttpCodes.SUCCESS if tokens_saved else HttpCodes.INTERNAL_SERVER_ERROR,
|
||||
@@ -184,7 +187,7 @@ async def mail_callback(
|
||||
# }
|
||||
# )
|
||||
|
||||
# Return a page that shows you the status of your authorization:
|
||||
# Return an HTML response:
|
||||
return await render_template(
|
||||
"/mail/oauth/oauth_success.html" if tokens_saved else "/mail/oauth/oauth_failure.html",
|
||||
mail_client = mail_client.title()
|
||||
|
||||
Reference in New Issue
Block a user