fix: Reusable Pre-Auth Keys no longer show expired when used (#88)

This commit is contained in:
kevinf100 2025-01-18 02:48:50 -05:00 committed by GitHub
parent 698122068d
commit 9bb20024fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ export default function Page() {
const expiry = new Date(key.expiration); const expiry = new Date(key.expiration);
if (status === 'Active') { if (status === 'Active') {
return !(expiry < now) && !key.used; return !(expiry < now) && (!key.used || key.reusable);
} }
if (status === 'Used/Expired') { if (status === 'Used/Expired') {

View File

@ -31,7 +31,7 @@ export default function AuthKeyRow({ authKey, server }: Props) {
tailscale up --login-server {server} --authkey {authKey.key} tailscale up --login-server {server} --authkey {authKey.key}
</Code> </Code>
<div className="flex gap-4 items-center"> <div className="flex gap-4 items-center">
{authKey.used || {authKey.used && !authKey.reusable ||
new Date(authKey.expiration) < new Date() ? undefined : ( new Date(authKey.expiration) < new Date() ? undefined : (
<ExpireKey authKey={authKey} /> <ExpireKey authKey={authKey} />
)} )}