Spaces:
Sleeping
Sleeping
Commit ·
9036c1d
1
Parent(s): 66e834a
Remove target='_blank' for single-page login experience
Browse files- Remove target='_blank' from login button
- Remove auto-refresh JavaScript
- Keep the critical SameSite=None session fix for iframe compatibility
- User preference: login in same page instead of new tab
- backend/routers/auth.py +1 -21
backend/routers/auth.py
CHANGED
|
@@ -338,32 +338,12 @@ async def login_page(request: Request):
|
|
| 338 |
</div>
|
| 339 |
|
| 340 |
<p>Please log in with your Hugging Face account to continue.</p>
|
| 341 |
-
<a href="/auth/login" class="login-btn"
|
| 342 |
-
|
| 343 |
-
<p style="margin-top: 20px; font-size: 12px; color: #666;">
|
| 344 |
-
<strong>Note:</strong> The login will open in a new tab. After logging in, please close the tab and refresh this page.
|
| 345 |
-
</p>
|
| 346 |
|
| 347 |
<p style="margin-top: 30px; font-size: 12px; color: #888;">
|
| 348 |
By logging in, you agree to use this service responsibly and in accordance with our usage policies.
|
| 349 |
</p>
|
| 350 |
</div>
|
| 351 |
-
|
| 352 |
-
<script>
|
| 353 |
-
// Check for login status every 3 seconds
|
| 354 |
-
setInterval(async function() {
|
| 355 |
-
try {
|
| 356 |
-
const response = await fetch('/auth/status');
|
| 357 |
-
const data = await response.json();
|
| 358 |
-
if (data.user_authenticated) {
|
| 359 |
-
// User is logged in, redirect to main app
|
| 360 |
-
window.location.href = '/';
|
| 361 |
-
}
|
| 362 |
-
} catch (error) {
|
| 363 |
-
console.log('Checking login status...');
|
| 364 |
-
}
|
| 365 |
-
}, 3000);
|
| 366 |
-
</script>
|
| 367 |
</body>
|
| 368 |
</html>
|
| 369 |
"""
|
|
|
|
| 338 |
</div>
|
| 339 |
|
| 340 |
<p>Please log in with your Hugging Face account to continue.</p>
|
| 341 |
+
<a href="/auth/login" class="login-btn">🚀 Login with Hugging Face</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
|
| 343 |
<p style="margin-top: 30px; font-size: 12px; color: #888;">
|
| 344 |
By logging in, you agree to use this service responsibly and in accordance with our usage policies.
|
| 345 |
</p>
|
| 346 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 347 |
</body>
|
| 348 |
</html>
|
| 349 |
"""
|