refactor CheckSetup()
This commit is contained in:
parent
4967d6bdf1
commit
cfd16e8e6c
@ -9,11 +9,7 @@ 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)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
usrSetup := UserInfoJson{
|
usrSetup := UserInfoJson{
|
||||||
Name: "setup",
|
Name: "setup",
|
||||||
Role: user.ROLE_SETUP,
|
Role: user.ROLE_SETUP,
|
||||||
@ -22,4 +18,8 @@ func (authMux *AuthMux) CheckSetup(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Header().Add("Content-Type", "application/json")
|
w.Header().Add("Content-Type", "application/json")
|
||||||
jsonString, _ := json.Marshal(usrSetup)
|
jsonString, _ := json.Marshal(usrSetup)
|
||||||
fmt.Fprintf(w, "%s", string(jsonString))
|
fmt.Fprintf(w, "%s", string(jsonString))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
authMux.accessDenied(w, r)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user