@@ -1216,7 +1229,17 @@
if ($code) {
no strict 'refs';
my $randompw = &{ $plugin->password_generator };
- if ( $plugin->user_password( code => $code, new_password => $randompw ) ) {
+
+ if (my $username = $plugin->user_password( code => $code, new_password => $randompw ) ) {
+ # Support a custom 'Change password' page or other app-based intervention after a successful reset code has been applied
+ foreach my $realm_check (@{ $plugin->realm_names }) { # $params->{realm} isn't defined at this point...
+ my $provider = $plugin->auth_provider($realm_check);
+ $params->{realm} = $realm_check if $provider->get_user_details($username);
+ }
+
+ $plugin->execute_plugin_hook( 'after_reset_code_success',
+ { username => $username, password => $randompw, realm => $params->{realm} } );
+
This allows a user to do a password change in the app.
(How else do people use reset codes?)
-N
PS: I also have:
@@ -1034,9 +1045,11 @@
$message{from} = $plugin->mail_from;
$message{plain} = <<__EMAIL;
A request has been received to reset your password for $appname. If
-you would like to do so, please follow the link below:
+you would like to do so, please click on the link below:
$site/login/$options{code}
+
+(If you are unable to click on the link, please copy and paste it into your browser).
because our users appear to need this extra help.