Files
auth-service/src/app/app.html

60 lines
3.0 KiB
HTML
Raw Normal View History

2026-05-21 15:05:53 +04:00
<main class="page">
2026-05-21 15:18:28 +04:00
<section class="login-card">
<div class="login-icon">
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path>
</svg>
2026-05-21 15:05:53 +04:00
</div>
2026-01-26 16:21:23 +04:00
2026-05-21 15:18:28 +04:00
@if (session(); as currentSession) {
<h1>Authenticated</h1>
<p class="status-copy">{{ statusMessage() }}</p>
<div class="session-card">
<strong>{{ currentSession.displayName }}</strong>
<span>
@if (currentSession.username) {
@{{ currentSession.username }}
} @else {
Telegram user {{ currentSession.telegramUserId }}
}
</span>
<span>Session {{ currentSession.sessionId }}</span>
<span>Expires {{ currentSession.expiresAt | date: 'medium' }}</span>
2026-05-21 15:05:53 +04:00
</div>
2026-05-21 15:18:28 +04:00
} @else {
<h1>Continue With Telegram</h1>
<p class="status-copy">{{ statusMessage() }}</p>
<button class="telegram-btn" type="button" (click)="openTelegram()" [disabled]="!telegramUrl() && state() === 'loading'">
<svg class="tg-icon" width="22" height="22" viewBox="0 0 24 24" fill="currentColor">
<path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"></path>
</svg>
Open Telegram
</button>
<div class="qr-section">
@if (state() === 'loading') {
<div class="qr-container qr-loading" aria-live="polite">
2026-05-21 15:05:53 +04:00
<div class="spinner"></div>
</div>
2026-05-21 15:18:28 +04:00
} @else if (state() === 'expired' || state() === 'error') {
<button class="qr-container qr-expired" type="button" (click)="refreshQr()" aria-label="Refresh QR code">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M1 4v6h6M23 20v-6h-6"></path>
<path d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"></path>
</svg>
<span>Refresh QR code</span>
</button>
} @else if (qrImageUrl()) {
<div class="qr-container qr-ready">
<img [src]="qrImageUrl()" alt="Telegram login QR code" width="220" height="220" loading="eager" />
2026-05-21 15:05:53 +04:00
</div>
2026-05-21 15:18:28 +04:00
}
2026-01-26 16:21:23 +04:00
</div>
2026-05-21 15:18:28 +04:00
<button class="secondary-btn" type="button" (click)="refreshQr()">Generate new QR</button>
}
2026-05-21 15:05:53 +04:00
</section>
2026-01-26 16:21:23 +04:00
</main>