mirror of https://github.com/jetkvm/kvm.git
Don't allow empty tokens (#13)
This commit is contained in:
parent
ca815c06f1
commit
e445039cb8
2
web.go
2
web.go
|
@ -192,7 +192,7 @@ func protectedMiddleware() gin.HandlerFunc {
|
|||
}
|
||||
|
||||
authToken, err := c.Cookie("authToken")
|
||||
if err != nil || authToken != config.LocalAuthToken {
|
||||
if err != nil || authToken != config.LocalAuthToken || authToken == "" {
|
||||
c.JSON(http.StatusUnauthorized, gin.H{"error": "Unauthorized"})
|
||||
c.Abort()
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue