From de26b55afeeac1924663e3053ef1d103e76ac437 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 12 Dec 2013 09:38:46 -0500 Subject: [PATCH] User.pm: Handle params from JSON properly Signed-off-by: Shea Levy --- src/lib/Hydra/Controller/User.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/Hydra/Controller/User.pm b/src/lib/Hydra/Controller/User.pm index 6a1a8552..b06c65b6 100644 --- a/src/lib/Hydra/Controller/User.pm +++ b/src/lib/Hydra/Controller/User.pm @@ -50,7 +50,7 @@ sub persona_login :Path('/persona-login') Args(0) { error($c, "Persona support is not enabled.") unless $c->stash->{personaEnabled}; - my $assertion = $c->req->params->{assertion} or die; + my $assertion = $c->stash->{params}->{assertion} or die; my $ua = new LWP::UserAgent; my $response = $ua->post( @@ -119,7 +119,7 @@ sub register :Local Args(0) { die unless $c->request->method eq "PUT"; - my $userName = trim $c->req->params->{username}; + my $userName = trim $c->stash->{params}->{username}; $c->stash->{username} = $userName; error($c, "You did not enter the correct digits from the security image.") @@ -154,21 +154,21 @@ sub register :Local Args(0) { sub updatePreferences { my ($c, $user) = @_; - my $fullName = trim($c->req->params->{fullname} // ""); + my $fullName = trim($c->stash->{params}->{fullname} // ""); error($c, "Your must specify your full name.") if $fullName eq ""; - my $password = trim($c->req->params->{password} // ""); + my $password = trim($c->stash->{params}->{password} // ""); if ($user->type eq "hydra" && ($user->password eq "!" || $password ne "")) { error($c, "You must specify a password of at least 6 characters.") unless isValidPassword($password); error($c, "The passwords you specified did not match.") - if $password ne trim $c->req->params->{password2}; + if $password ne trim $c->stash->{params}->{password2}; setPassword($user, $password); } - my $emailAddress = trim($c->req->params->{emailaddress} // ""); + my $emailAddress = trim($c->stash->{params}->{emailaddress} // ""); # FIXME: validate email address? $user->update(