mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
decrement accessk key on use
This commit is contained in:
@@ -176,6 +176,7 @@ func nodeauth(next http.Handler) http.HandlerFunc {
|
||||
for _, key := range network.AccessKeys {
|
||||
if key.Value == token {
|
||||
found = true
|
||||
logic.DecrimentKey(network.NetID, key.Value)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -188,6 +189,7 @@ func nodeauth(next http.Handler) http.HandlerFunc {
|
||||
logic.ReturnErrorResponse(w, r, errorResponse)
|
||||
return
|
||||
}
|
||||
|
||||
next.ServeHTTP(w, r)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user