Merge branch 'dev' into feature/blog
THAT WAS PAINFUL!
This commit is contained in:
commit
3e5ecb9372
99 changed files with 2029 additions and 1010 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package auth
|
||||
|
||||
import (
|
||||
"arimelody-web/admin/core"
|
||||
"arimelody-web/admin/templates"
|
||||
"arimelody-web/controller"
|
||||
"arimelody-web/log"
|
||||
|
|
@ -135,12 +136,8 @@ func LoginHandler(app *model.AppState) http.Handler {
|
|||
|
||||
session := r.Context().Value("session").(*model.Session)
|
||||
|
||||
type loginData struct {
|
||||
Session *model.Session
|
||||
}
|
||||
|
||||
render := func() {
|
||||
err := templates.LoginTemplate.Execute(w, loginData{ Session: session })
|
||||
err := templates.LoginTemplate.Execute(w, core.AdminPageData{ Session: session })
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "WARN: Error rendering admin login page: %s\n", err)
|
||||
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
|
||||
|
|
@ -251,12 +248,8 @@ func LoginTOTPHandler(app *model.AppState) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
type loginTOTPData struct {
|
||||
Session *model.Session
|
||||
}
|
||||
|
||||
render := func() {
|
||||
err := templates.LoginTOTPTemplate.Execute(w, loginTOTPData{ Session: session })
|
||||
err := templates.LoginTOTPTemplate.Execute(w, core.AdminPageData{ Session: session })
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "WARN: Failed to render login TOTP page: %v\n", err)
|
||||
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue