def write_tokens(auth_token, refresh_token): utils.p('writing tokens') preferences = bpy.context.preferences.addons['blenderkit'].preferences preferences.api_key_refresh = refresh_token preferences.api_key = auth_token preferences.login_attempt = False props = utils.get_search_props() props.report = 'Login success!' search.get_profile() categories.fetch_categories_thread(auth_token)
def write_tokens(auth_token, refresh_token, oauth_response): utils.p('writing tokens') preferences = bpy.context.preferences.addons['blenderkit'].preferences preferences.api_key_refresh = refresh_token preferences.api_key = auth_token preferences.api_key_timeout = time.time() + oauth_response['expires_in'] preferences.api_key_life = oauth_response['expires_in'] preferences.login_attempt = False preferences.refresh_in_progress = False props = utils.get_search_props() if props is not None: props.report = '' ui.add_report('BlenderKit Re-Login success') search.get_profile() categories.fetch_categories_thread(auth_token)