diff --git a/oauth_handler.py b/oauth_handler.py index 711156f..cfb2ae5 100644 --- a/oauth_handler.py +++ b/oauth_handler.py @@ -79,6 +79,19 @@ class OAuthCallbackHandler: with open(display_marker_path, "w") as f: f.write("display_only_setup_completed") + # Print credentials to console for easy copy/paste + print("\n" + "=" * 80) + print("🔥 DROPBOX CREDENTIALS READY FOR PRODUCTION - COPY FROM CONSOLE 🔥") + print("=" * 80) + print(f"DROPBOX_APP_KEY={self.app_key}") + print(f"DROPBOX_APP_SECRET={self.app_secret}") + print(f"DROPBOX_REFRESH_TOKEN={refresh_token}") + print(f"DROPBOX_FOLDER={self.dropbox_folder}") + print("=" * 80) + print("📋 Copy the lines above to your environment variables!") + print("🚀 Perfect for RunPod, Docker, and production environments!") + print("=" * 80 + "\n") + success_message = f"""✅ Dropbox Connected Successfully! ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -103,19 +116,22 @@ DROPBOX_FOLDER={self.dropbox_folder} auth_manager.store_tokens(self.app_key, self.app_secret, refresh_token) success_message = "✅ Dropbox connected successfully! Credentials stored securely in system keyring." - # Send WebSocket message to trigger ComfyUI refresh - try: - from server import PromptServer - message_data = { - "type": "dropbox_oauth_complete", - "session_id": self.session_id, - "success": True, - "message": success_message - } - PromptServer.instance.send_sync("dropbox_oauth_complete", message_data) - print(f"[OAuthHandler] Sent WebSocket notification for OAuth completion") - except Exception as e: - print(f"[OAuthHandler] Warning: Could not send WebSocket notification: {e}") + # Send WebSocket message to trigger ComfyUI refresh (except for display_only) + if self.storage_method != "display_only": + try: + from server import PromptServer + message_data = { + "type": "dropbox_oauth_complete", + "session_id": self.session_id, + "success": True, + "message": success_message + } + PromptServer.instance.send_sync("dropbox_oauth_complete", message_data) + print(f"[OAuthHandler] Sent WebSocket notification for OAuth completion") + except Exception as e: + print(f"[OAuthHandler] Warning: Could not send WebSocket notification: {e}") + else: + print(f"[OAuthHandler] Skipping WebSocket notification for display_only method - no auto-refresh") # Call completion callback if provided if self.completion_callback: @@ -309,7 +325,7 @@ def create_display_only_success_page(session_id, app_key, app_secret, refresh_to