aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/Update.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2015-07-09 20:33:51 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-07-10 13:49:25 +0100
commit2ac123a2e0e4594099a11057647ffc190219993d (patch)
tree4cfa460cb78461b6c5958f6d06dce497d11378a5 /perllib/FixMyStreet/App/Controller/Report/Update.pm
parenta978c0a1ad216f7004ef88b8a58b9731242155dc (diff)
Alter token logging in and timeout behaviour.
Restrict email_sign_in token to one day, unused confirmation tokens to one month. Used tokens will redirect to the created thing but not log in; don't log in with alert links (unsubscribe link never expires, reply link will still show "reopen" tickbox).
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 79fed0fd1..17aec2113 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -420,8 +420,8 @@ happen before calling this.
sub signup_for_alerts : Private {
my ( $self, $c ) = @_;
+ my $update = $c->stash->{update};
if ( $c->stash->{add_alert} ) {
- my $update = $c->stash->{update};
my $options = {
user => $update->user,
alert_type => 'new_updates',
@@ -438,7 +438,7 @@ sub signup_for_alerts : Private {
}
$alert->confirm();
- } elsif ( $c->user && ( my $alert = $c->user->alert_for_problem($c->stash->{update}->problem_id) ) ) {
+ } elsif ( my $alert = $update->user->alert_for_problem($update->problem_id) ) {
$alert->disable();
}