Ephemeral keys can now be reusable and non-reusable

Fixes the issue reported in #1712. In Tailscale SaaS, ephemeral keys can be single-user or reusable. Until now, our ephemerals were only reusable. This PR makes us adhere to the .com behaviour.
This commit is contained in:
Juan Font 2024-03-03 10:11:10 +00:00
parent e15a08326c
commit a244eabd03
3 changed files with 38 additions and 12 deletions

View file

@ -196,7 +196,7 @@ func ValidatePreAuthKey(tx *gorm.DB, k string) (*types.PreAuthKey, error) {
return nil, ErrPreAuthKeyExpired
}
if pak.Reusable || pak.Ephemeral { // we don't need to check if has been used before
if pak.Reusable { // we don't need to check if has been used before
return &pak, nil
}