(20250625) - Implemented the ecommerce shopify auth integration.
with multiple files added new API for get token details
This commit is contained in:
@@ -408,6 +408,64 @@ class CoreAuthTokenController(CoreBaseModel):
|
||||
# Done here:
|
||||
return success
|
||||
|
||||
# CREATED BY OMKAR -------------------------------------------------------------------------------------------------
|
||||
# 25 - 06 - 2025
|
||||
# SET TOKEN WITH RETURN TOKEN --------------------------------------------------------------------------------------
|
||||
|
||||
async def set_token_direct_with_return_id(
|
||||
self,
|
||||
sql_conn: AsyncMySQL,
|
||||
mongo_data_conn: AsyncMongo,
|
||||
auth_token: CoreAuthTokenModel,
|
||||
token_notes: dict,
|
||||
display_name: str = None,
|
||||
display_picture: str = None,
|
||||
session_token: str = None
|
||||
) -> (bool, str) :
|
||||
|
||||
"""
|
||||
Some authorizations don't need two steps, but our core system works on the 2-step approach that was developed to
|
||||
work with Google's GMail OAuth2.0 mechanism.
|
||||
:param sql_conn: The database connection (MariaDB) to use to perform the action.
|
||||
:param mongo_data_conn: The database connection (MongoDB) to use to perform the action.
|
||||
:param auth_token: The actual auth/token data to be saved to the database.
|
||||
:param token_notes: Any notes to feed into MariaDB with the token identifier.
|
||||
:param display_name: The name of the user to user as their display name.
|
||||
:param display_picture: The URL at which you will find a display picture of the user.
|
||||
:param session_token: The session token of the user who requested this service.
|
||||
:return: True if saved, False if failed.
|
||||
"""
|
||||
|
||||
# Start by assuming failure:
|
||||
success = False
|
||||
|
||||
# Get a token id (and receive its key):
|
||||
token_key = await self.generate_token_key(
|
||||
sql_conn = sql_conn,
|
||||
mongo_data_conn = mongo_data_conn,
|
||||
auth_token = auth_token,
|
||||
token_notes = token_notes,
|
||||
display_name = display_name,
|
||||
display_picture = display_picture,
|
||||
session_token = session_token
|
||||
)
|
||||
|
||||
# Immediately save the details against that token id:
|
||||
success = await self.set_token(
|
||||
sql_conn = sql_conn,
|
||||
mongo_data_conn = mongo_data_conn,
|
||||
token_key = token_key,
|
||||
auth_token = auth_token,
|
||||
token_notes = token_notes,
|
||||
display_name = display_name,
|
||||
display_picture = display_picture,
|
||||
session_token = session_token
|
||||
)
|
||||
|
||||
# Done here:
|
||||
return success, token_key
|
||||
|
||||
|
||||
async def modify_status_by_token_key(
|
||||
self,
|
||||
sql_conn: AsyncMySQL,
|
||||
|
||||
Reference in New Issue
Block a user