diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Auth')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth/Phone.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth/Profile.pm | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth/Phone.pm b/perllib/FixMyStreet/App/Controller/Auth/Phone.pm index 4e9f92596..e4ffc2205 100644 --- a/perllib/FixMyStreet/App/Controller/Auth/Phone.pm +++ b/perllib/FixMyStreet/App/Controller/Auth/Phone.pm @@ -45,19 +45,19 @@ and sets up the token/etc to deal with the response. =cut sub sign_in : Private { - my ( $self, $c, $phone ) = @_; + my ( $self, $c, $parsed ) = @_; - unless ($phone) { + unless ($parsed->{phone}) { $c->stash->{username_error} = 'other_phone'; return; } - unless ($phone->is_mobile) { + unless ($parsed->{may_be_mobile}) { $c->stash->{username_error} = 'nonmobile'; return; } - (my $number = $phone->format) =~ s/\s+//g; + (my $number = $parsed->{phone}->format) =~ s/\s+//g; if ( FixMyStreet->config('SIGNUPS_DISABLED') && !$c->model('DB::User')->find({ phone => $number }) diff --git a/perllib/FixMyStreet/App/Controller/Auth/Profile.pm b/perllib/FixMyStreet/App/Controller/Auth/Profile.pm index ecf009150..acffd3019 100644 --- a/perllib/FixMyStreet/App/Controller/Auth/Profile.pm +++ b/perllib/FixMyStreet/App/Controller/Auth/Profile.pm @@ -118,14 +118,14 @@ sub change_phone : Path('/auth/change_phone') { # If we've not used a mobile and we're not specifically verifying, # and phone isn't our only verified way of logging in, # then allow change of number (for e.g. landline). - if (!FixMyStreet->config('SMS_AUTHENTICATION') || (!$parsed->{phone}->is_mobile && !$c->stash->{verifying} && $c->user->email_verified)) { + if (!FixMyStreet->config('SMS_AUTHENTICATION') || (!$parsed->{may_be_mobile} && !$c->stash->{verifying} && $c->user->email_verified)) { $c->user->update({ phone => $phone, phone_verified => 0 }); $c->flash->{flash_message} = _('You have successfully added your phone number.'); $c->res->redirect('/my'); $c->detach; } - $c->forward('/auth/phone/sign_in', [ $parsed->{phone} ]); + $c->forward('/auth/phone/sign_in', [ $parsed ]); } sub verify_item : Path('/auth/verify') : Args(1) { |