feat: first time admin user creation through the ui

This commit is contained in:
Deluan
2020-01-25 17:10:16 -05:00
parent b4c95fa8db
commit 58a7879ba8
9 changed files with 301 additions and 147 deletions
+2 -1
View File
@@ -43,11 +43,12 @@ func (app *Router) routes() http.Handler {
r.Get("/ping", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(`{"response":"pong"}`)) })
r.Post("/login", Login(app.ds))
r.Post("/createAdmin", CreateAdmin(app.ds))
r.Route("/api", func(r chi.Router) {
if !conf.Server.DevDisableAuthentication {
r.Use(jwtauth.Verifier(TokenAuth))
r.Use(Authenticator)
r.Use(Authenticator(app.ds))
}
app.R(r, "/user", model.User{})
app.R(r, "/song", model.MediaFile{})