mirror of
https://github.com/gravitl/netmaker.git
synced 2025-12-19 17:18:32 +08:00
decrement accessk key on use
This commit is contained in:
parent
d7b6baceb2
commit
0049c2bcad
1 changed files with 2 additions and 0 deletions
|
|
@ -176,6 +176,7 @@ func nodeauth(next http.Handler) http.HandlerFunc {
|
||||||
for _, key := range network.AccessKeys {
|
for _, key := range network.AccessKeys {
|
||||||
if key.Value == token {
|
if key.Value == token {
|
||||||
found = true
|
found = true
|
||||||
|
logic.DecrimentKey(network.NetID, key.Value)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -188,6 +189,7 @@ func nodeauth(next http.Handler) http.HandlerFunc {
|
||||||
logic.ReturnErrorResponse(w, r, errorResponse)
|
logic.ReturnErrorResponse(w, r, errorResponse)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue