mirror of
https://github.com/volatiletech/authboss.git
synced 2025-01-06 03:54:17 +02:00
Fix registration to allow custom field validation
This commit is contained in:
parent
24b9501709
commit
ab0d56f2e2
@ -84,8 +84,7 @@ func (reg *Register) registerPostHandler(ctx *authboss.Context, w http.ResponseW
|
||||
key, _ := ctx.FirstPostFormValue(reg.PrimaryID)
|
||||
password, _ := ctx.FirstPostFormValue(authboss.StorePassword)
|
||||
|
||||
policies := authboss.FilterValidators(reg.Policies, reg.PrimaryID, authboss.StorePassword)
|
||||
validationErrs := ctx.Validate(policies, reg.ConfirmFields...)
|
||||
validationErrs := ctx.Validate(reg.Policies, reg.ConfirmFields...)
|
||||
|
||||
if len(validationErrs) != 0 {
|
||||
data := authboss.HTMLData{
|
||||
|
@ -119,6 +119,7 @@ func TestRegisterPostValidationErrs(t *testing.T) {
|
||||
|
||||
func TestRegisterPostSuccess(t *testing.T) {
|
||||
reg := setup()
|
||||
reg.Policies = nil
|
||||
|
||||
w := httptest.NewRecorder()
|
||||
vals := url.Values{}
|
||||
|
Loading…
Reference in New Issue
Block a user