feat(frontend): show user credential expiry

This commit is contained in:
2026-05-06 22:13:54 +08:00
parent ce55cfc6b3
commit 3fceb1516c
4 changed files with 63 additions and 0 deletions
@@ -13,6 +13,7 @@ import {
} from '@/components/ui'
import { Button } from '@/components/ui/button'
import { extractErrorMessage, formatDateTime } from '@/utils/format'
import { formatUserAuthorizationSummary } from '../dashboard-license'
const loading = ref(true)
const error = ref('')
@@ -33,6 +34,10 @@ function requiresUnverifiedEmailOverride(
return 'requires_override' in result && result.warning_code === 'UNVERIFIED_EMAIL'
}
function userAuthorizationSummary(user: User) {
return formatUserAuthorizationSummary(user.jwt_exp)
}
async function load() {
loading.value = true
error.value = ''
@@ -162,6 +167,9 @@ onMounted(load)
<div class="mt-1 flex flex-wrap gap-x-3 gap-y-1 text-sm text-muted-foreground">
<span>{{ user.email || '未设置邮箱' }}</span>
<span>{{ user.email_verified ? '邮箱已验证' : '邮箱未验证' }}</span>
<span :class="toneClass(userAuthorizationSummary(user).tone)">{{
userAuthorizationSummary(user).label
}}</span>
<span>{{ formatDateTime(user.created_at) }}</span>
</div>
</div>