Skip to content

Commit d61bca3

Browse files
committed
fix: minor fixes
1 parent b1da0c2 commit d61bca3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

plugins/auth/middleware.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ func (a *Auth) basicAuth(h http.HandlerFunc) http.HandlerFunc {
174174
}
175175

176176
if !authenticated {
177-
errorMsg = "only admin users are allowed to access elasticsearch"
177+
if reqCategory.IsFromRS() {
178+
errorMsg = "only admin users are allowed to access reactivesearch"
179+
} else {
180+
errorMsg = "only admin users are allowed to access elasticsearch"
181+
}
182+
178183
}
179184

180185
// cache the user
@@ -196,12 +201,11 @@ func (a *Auth) basicAuth(h http.HandlerFunc) http.HandlerFunc {
196201
return
197202
}
198203

199-
log.Println("THIS IS THE THING HERE", *reqCategory, *reqCategory == category.ReactiveSearch, reqPermission.HasCategory(category.ReactiveSearch))
200204
if reqPermission.HasCategory(*reqCategory) {
201205
authenticated = true
202206
} else {
203207
str := (*reqCategory).String()
204-
errorMsg = "credential is not allowed to access" + str
208+
errorMsg = "credential is not allowed to access" + " " + str
205209
}
206210

207211
// cache the permission

0 commit comments

Comments
 (0)