1
0
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:
Kris Runzer 2015-04-10 13:38:51 -07:00
parent 24b9501709
commit ab0d56f2e2
2 changed files with 2 additions and 2 deletions

View File

@ -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{

View File

@ -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{}