refactor CheckSetup()

This commit is contained in:
Settel 2023-01-29 16:14:23 +01:00
parent 4967d6bdf1
commit cfd16e8e6c

View File

@ -9,17 +9,17 @@ import (
) )
func (authMux *AuthMux) CheckSetup(w http.ResponseWriter, r *http.Request) { func (authMux *AuthMux) CheckSetup(w http.ResponseWriter, r *http.Request) {
if authMux.app.IsInitialized() { if !authMux.app.IsInitialized() {
authMux.accessDenied(w, r) usrSetup := UserInfoJson{
Name: "setup",
Role: user.ROLE_SETUP,
}
w.Header().Add("Content-Type", "application/json")
jsonString, _ := json.Marshal(usrSetup)
fmt.Fprintf(w, "%s", string(jsonString))
return return
} }
usrSetup := UserInfoJson{ authMux.accessDenied(w, r)
Name: "setup",
Role: user.ROLE_SETUP,
}
w.Header().Add("Content-Type", "application/json")
jsonString, _ := json.Marshal(usrSetup)
fmt.Fprintf(w, "%s", string(jsonString))
} }