Hi, I am associating the roles to a user after the session has already been created, I am trying to manually add the roles and permissions to a session using in the following way in consume override function:
def override_passwordless_apis(original_implementation: APIInterface):
original_consume_code_post = original_implementation.consume_code_post
async def consume_code_post(pre_auth_session_id: str,
user_input_code: Union[str, None],
device_id: Union[str, None],
link_code: Union[str, None],
api_options: APIOptions,
user_context: Dict[str, Any]):
res = await add_role_to_user("public",userid_field, role_name)
await session.fetch_and_set_claim(UserRoleClaim)
How to get session object inside this signup overide function