aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/Update.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-10-10 14:54:04 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-10-12 12:49:50 +0100
commit8a3072bfdc11121da5a11932c248ab13f6f0d315 (patch)
treef68127e72901d5af130a58b352bf98e4311f084f /perllib/FixMyStreet/App/Controller/Report/Update.pm
parent00bc27f2e9abcc6d5c6be71ef5a58cb32f1a028b (diff)
Factor the three SMS code checking fns together.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm14
1 files changed, 2 insertions, 12 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 66724f2d1..c28039808 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -521,18 +521,8 @@ sub send_confirmation_text : Private {
sub confirm_by_text : Path('text') {
my ( $self, $c ) = @_;
- my $token = $c->stash->{token} = $c->get_param('token');
- my $code = $c->get_param('code') || '';
-
- my $data = $c->stash->{token_data} = $c->forward('/auth/get_token', [ $token, 'comment' ]) || return;
- if ($data->{code} ne $code) {
- $c->stash->{template} = 'auth/smsform.html';
- $c->stash->{submit_url} = '/report/update/text';
- $c->stash->{incorrect_code} = 1;
- return;
- }
-
- $c->detach('process_confirmation');
+ $c->stash->{submit_url} = '/report/update/text';
+ $c->forward('/auth/phone/code', [ 'comment', '/report/update/process_confirmation' ]);
}
sub process_confirmation : Private {