Hi, I am associating the roles to a user after th...
# support-questions-legacy
n
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
r
hey @Namratha you can get it by callingt he original impl of consume_code_post. The result of it has the session object if consume was successful
8 Views