v0.3.0-unstable15

This commit is contained in:
Yann Stepienik 2023-05-01 13:07:01 +01:00
parent e93e45d4df
commit a932933550
2 changed files with 7 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.3.0-unstable14",
"version": "0.3.0-unstable15",
"description": "",
"main": "test-server.js",
"bugs": {

View file

@ -39,9 +39,13 @@ func tokenMiddleware(enabled bool, adminOnly bool) func(next http.Handler) http.
r.Header.Set("x-cosmos-token", "1234567890")
if enabled && adminOnly {
utils.AdminOnlyWithRedirect(w, r)
if errT := utils.AdminOnlyWithRedirect(w, r); errT != nil {
return
}
} else if enabled {
utils.LoggedInOnlyWithRedirect(w, r)
if errT := utils.LoggedInOnlyWithRedirect(w, r); errT != nil {
return
}
}
next.ServeHTTP(w, r)