From ab0d56f2e28af44d877c503e53e2d2b66f73f4aa Mon Sep 17 00:00:00 2001 From: Kris Runzer Date: Fri, 10 Apr 2015 13:38:51 -0700 Subject: [PATCH] Fix registration to allow custom field validation --- register/register.go | 3 +-- register/register_test.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/register/register.go b/register/register.go index c9e4651..117da4d 100644 --- a/register/register.go +++ b/register/register.go @@ -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{ diff --git a/register/register_test.go b/register/register_test.go index e72b027..424d2f9 100644 --- a/register/register_test.go +++ b/register/register_test.go @@ -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{}