aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result/User.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-11-05 10:24:27 +0000
committerMatthew Somerville <matthew@mysociety.org>2019-11-05 10:24:27 +0000
commit78f2bbaf9291572a86816e2ba05ec8972b0fd393 (patch)
tree1b77b3cadc481042891a68d9c70d090a80d480d2 /perllib/FixMyStreet/DB/Result/User.pm
parent0c69d1b65c0060fc28331d15f63e28b6b3074f48 (diff)
parent1a4e43acee3614b6f960fed4325a480f41692daa (diff)
Merge branch 'password-expiry'
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/User.pm')
-rw-r--r--perllib/FixMyStreet/DB/Result/User.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm
index 805ea4776..9554bbe7e 100644
--- a/perllib/FixMyStreet/DB/Result/User.pm
+++ b/perllib/FixMyStreet/DB/Result/User.pm
@@ -167,6 +167,14 @@ __PACKAGE__->add_columns(
},
);
+around password => sub {
+ my ($orig, $self) = (shift, shift);
+ if (@_) {
+ $self->set_extra_metadata(last_password_change => time());
+ }
+ $self->$orig(@_);
+};
+
=head2 username
Returns a verified email or phone for this user, preferring email,