~evanj/cms

5a31897a9ee199bd9af7eb256645afe2c7cbf045 — Evan J 2 months ago da13ad0
Chore(user/TODO): Remove @chief signups. Add more to TODO.
2 files changed, 14 insertions(+), 11 deletions(-)

M TODO
M internal/c/user/user.go
M TODO => TODO +5 -2
@@ 6,13 6,16 @@ Depth option on APIs
When editing existing references don't blow away prev inputs
Forgot password
Warn & delete excess users/spaces on downgrade.
Cache: org?, invite?, role?, hook
Cache: org?, invite?, role?, hook 
Admin: change role level of users.
Provide description of different roles (new page).
Add more value types: number, time, datetime (already have time), timestamp?, 
  json

[med]
Cache lists
Official Go API
Pay Goatounter
Pay Goatcounter
Pay logo: mybrandnewlogo.com

[low]

M internal/c/user/user.go => internal/c/user/user.go +9 -9
@@ 6,7 6,6 @@ import (
	"net/http"
	"net/url"
	"strconv"
	"strings"

	"git.sr.ht/~evanj/cms/internal/c"
	"git.sr.ht/~evanj/cms/internal/m/space"


@@ 73,19 72,20 @@ func (l *User) login(w http.ResponseWriter, r *http.Request) {
}

func (l *User) signup(w http.ResponseWriter, r *http.Request) {
	username := r.FormValue("username")
	password := r.FormValue("password")
	verify := r.FormValue("verify")

	t, ok := tier.ByName(r.FormValue("tier"))
	var (
		username = r.FormValue("username")
		password = r.FormValue("password")
		verify   = r.FormValue("verify")
		tierName = r.FormValue("tier")
	)

	t, ok := tier.ByName(tierName)
	if !ok {
		l.Error(w, r, http.StatusBadRequest, ErrNoTier)
		return
	}

	isChief := strings.Contains(username, "@chief") && t.Is(tier.Free)

	if !l.signupEnabled && !isChief {
	if !l.signupEnabled {
		l.Error(w, r, http.StatusForbidden, ErrNoSignup)
		return
	}