Preload the namespace

This commit is contained in:
Juan Font Alonso committed 2021-05-06 00:59:16 +02:00
1 parent 3110dd1575
commit 9ce8dc3fb6
1 file changed
+1 -1
+1 -1
View File
@@ -86,7 +86,7 @@ func (h *Headscale) checkKeyValidity(k string) (*PreAuthKey, error) {
defer db.Close()
pak := PreAuthKey{}
if db.First(&pak, "key = ?", k).RecordNotFound() {
if db.Preload("Namespace").First(&pak, "key = ?", k).RecordNotFound() {
return nil, errorAuthKeyNotFound
}