| import gradio as gr | |
| # Hardcoded username and password for demonstration | |
| # In a real application, use a more secure method | |
| USERNAME = "user" | |
| PASSWORD = "password" | |
| def login(username, password): | |
| if username == USERNAME and password == PASSWORD: | |
| return True, "Login successful!" | |
| else: | |
| return False, "Invalid username or password." | |
| # protected_content.py | |
| def protected_content(): | |
| return "Welcome to the protected content! This is only visible after successful login." | |