chore(webui): rewrite the web session code again while preparing for csrf tokens
#60
This commit is contained in:
parent
3bb5e735c6
commit
895615ad6e
20 changed files with 162 additions and 149 deletions
|
@ -11,7 +11,6 @@ import (
|
|||
|
||||
type AccountsPage struct {
|
||||
Accounts []model.Account
|
||||
ActiveTab int
|
||||
IsAdmin string
|
||||
Page *Page
|
||||
Username string
|
||||
|
@ -45,11 +44,10 @@ func handleAccountsPOST(db *database.DB) http.Handler {
|
|||
accountUsername := r.FormValue("username")
|
||||
isAdmin := r.FormValue("isAdmin")
|
||||
page := AccountsPage{
|
||||
ActiveTab: 1,
|
||||
Page: makePage(r, &Page{Title: "New Account", Section: "accounts"}),
|
||||
Accounts: accounts,
|
||||
IsAdmin: isAdmin,
|
||||
Username: accountUsername,
|
||||
Page: makePage(r, &Page{Title: "New Account", Section: "accounts"}),
|
||||
Accounts: accounts,
|
||||
IsAdmin: isAdmin,
|
||||
Username: accountUsername,
|
||||
}
|
||||
if ok := validUsername.MatchString(accountUsername); !ok {
|
||||
page.UsernameInvalid = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue