Render a waiting page shown when the edge proxy auth cookie is not yet present. This can happen if the edge proxy hasn't completed authentication yet. The page auto-reloads after a short delay to pick up the cookie once login finishes. The `code` parameter is preserved across reloads.
(callback_port: u16, code: &str)
| 405 | /// page auto-reloads after a short delay to pick up the cookie once login |
| 406 | /// finishes. The `code` parameter is preserved across reloads. |
| 407 | fn render_waiting_page(callback_port: u16, code: &str) -> String { |
| 408 | let safe_code = html_escape(code); |
| 409 | format!( |
| 410 | r#"<!DOCTYPE html> |
| 411 | <html lang="en"> |
| 412 | <head> |
| 413 | <meta charset="utf-8"> |
| 414 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 415 | <meta http-equiv="refresh" content="2;url=/auth/connect?callback_port={callback_port}&code={safe_code}"> |
| 416 | <title>OpenShell — Authenticating</title> |
| 417 | <style> |
| 418 | * {{ margin: 0; padding: 0; box-sizing: border-box; }} |
| 419 | body {{ |
| 420 | font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace; |
| 421 | background: #f5f5f5; |
| 422 | color: #1a1a1a; |
| 423 | min-height: 100vh; |
| 424 | display: flex; |
| 425 | align-items: center; |
| 426 | justify-content: center; |
| 427 | }} |
| 428 | .card {{ |
| 429 | background: #ffffff; |
| 430 | border: 1px solid #e0e0e0; |
| 431 | border-radius: 12px; |
| 432 | padding: 48px; |
| 433 | max-width: 480px; |
| 434 | width: 100%; |
| 435 | text-align: center; |
| 436 | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); |
| 437 | }} |
| 438 | .logo {{ |
| 439 | font-size: 28px; |
| 440 | font-weight: 700; |
| 441 | color: #76b900; |
| 442 | margin-bottom: 8px; |
| 443 | }} |
| 444 | .message {{ |
| 445 | color: #666; |
| 446 | font-size: 14px; |
| 447 | margin-top: 16px; |
| 448 | }} |
| 449 | .spinner {{ |
| 450 | margin: 24px auto; |
| 451 | width: 32px; |
| 452 | height: 32px; |
| 453 | border: 3px solid #e0e0e0; |
| 454 | border-top-color: #76b900; |
| 455 | border-radius: 50%; |
| 456 | animation: spin 0.8s linear infinite; |
| 457 | }} |
| 458 | @keyframes spin {{ |
| 459 | to {{ transform: rotate(360deg); }} |
| 460 | }} |
| 461 | </style> |
| 462 | </head> |
| 463 | <body> |
| 464 | <div class="card"> |