diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-10-29 15:15:37 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-11-04 17:10:23 +0000 |
commit | 5220946f4f7f256e692402e747c7beab90a99d2a (patch) | |
tree | 1fc4bba4ba85ae8f3a1560b79ec1dbf18eadd29d /perllib/FixMyStreet/DB/Result/User.pm | |
parent | f93bc85184077506c555e444c55abbeb1976f03e (diff) |
Record time of password change.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/User.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 8 |
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, |