aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Tokens.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-02-11 15:42:30 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-02-13 14:31:09 +0000
commitcf4f4473a795d2e1dd213f31b3d3fb4ab2711b72 (patch)
tree483a7498f7ff30a541e175b2fa460e595359a028 /perllib/FixMyStreet/App/Controller/Tokens.pm
parente2e6f7babbb04d2a78dc3fbf43eb4f7865672444 (diff)
Link in other-reported email shows private report.
Use a token that does not log the user in, but lets the report be shown, even if it's a private report. Allow old tokens of that type to work.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Tokens.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Tokens.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Tokens.pm b/perllib/FixMyStreet/App/Controller/Tokens.pm
index 659d763de..c4e601a85 100644
--- a/perllib/FixMyStreet/App/Controller/Tokens.pm
+++ b/perllib/FixMyStreet/App/Controller/Tokens.pm
@@ -185,9 +185,7 @@ sub alert_to_reporter : Path('/R') {
my $problem = $c->model('DB::Problem')->find( { id => $problem_id } )
|| $c->detach('token_error');
- $c->detach('token_too_old') if $auth_token->created < DateTime->now->subtract( months => 1 );
-
- $c->flash->{alert_to_reporter} = 1;
+ $c->flash->{alert_to_reporter} = $problem->id;
my $report_uri = $c->cobrand->base_url_for_report( $problem ) . $problem->url;
$c->res->redirect($report_uri);
}