Skip to content

Commit

Permalink
fix (admin): bug in admin
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-kerjean committed Oct 9, 2023
1 parent ac0fdc7 commit 3d606dc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/ctrl/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,11 @@ func LegacyServeFile(res http.ResponseWriter, req *http.Request, filePath string

func ServeBackofficeHandler(ctx *App, res http.ResponseWriter, req *http.Request) {
url := req.URL.Path
if url != URL_SETUP && Config.Get("auth.admin").String() == "" {
http.Redirect(res, req, URL_SETUP, http.StatusTemporaryRedirect)
return
}

if filepath.Ext(filepath.Base(url)) == "" {
if url != URL_SETUP && Config.Get("auth.admin").String() == "" {
http.Redirect(res, req, URL_SETUP, http.StatusTemporaryRedirect)
return
}
ServeFile(res, req, WWWPublic, "index.backoffice.html")
return
}
Expand Down

0 comments on commit 3d606dc

Please sign in to comment.