mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-28 17:26:52 +09:00
1 parent
dd1e425d02
commit
30788e1a70
4 files changed
+20
-3
No files matched your search
+2
-2
@@ -21,6 +21,7 @@ type PreAuthKey struct {
|
||||
Namespace Namespace
|
||||
Reusable bool
|
||||
Ephemeral bool `gorm:"default:false"`
|
||||
AlreadyUsed bool `gorm:"default:false"`
|
||||
|
||||
CreatedAt *time.Time
|
||||
Expiration *time.Time
|
||||
@@ -110,11 +111,10 @@ func (h *Headscale) checkKeyValidity(k string) (*PreAuthKey, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(machines) != 0 {
|
||||
if len(machines) != 0 || pak.AlreadyUsed {
|
||||
return nil, errorAuthKeyNotReusableAlreadyUsed
|
||||
}
|
||||
|
||||
// missing here validation on current usage
|
||||
return &pak, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user