fix: Reusable Pre-Auth Keys no longer show expired when used (#88)
This commit is contained in:
parent
698122068d
commit
9bb20024fa
@ -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') {
|
||||||
|
|||||||
@ -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} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user