Skip to content

Commit 19e9211

Browse files
committed
feat: check public key in update validity
Signed-off-by: nabil salah <nabil.salah203@gmail.com>
1 parent b707727 commit 19e9211

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

node-registrar/pkg/server/handlers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,10 @@ func (s *Server) updateAccountHandler(c *gin.Context) {
617617
return
618618
}
619619

620-
// if req.PubKey != "" && isValidPublicKey(req.PubKey) {
621-
// c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "invalid Public Key format"})
622-
// return
623-
// }
620+
if req.PubKey != "" && isValidPublicKey(req.PubKey) {
621+
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "invalid Public Key format"})
622+
return
623+
}
624624

625625
err = s.db.UpdateAccount(twinID, req.Relays, req.RMBEncKey, req.PubKey)
626626
if err != nil {

0 commit comments

Comments
 (0)