Jake Vanderwerf
2026-03-29 275c0d74cd68677622a5431505c5c870c473063d
inc/rest/routes/LoginRoutes.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\rest\routes;
use JVBase\registrar\Registrar;
use JVBase\rest\Rest;
use JVBase\rest\Route;
use JVBase\utility\Features;
@@ -340,7 +341,7 @@
               'error' => $key->get_error_message(),
            ]);
         } else {
            $this->sendPasswordResetEmail($user, $key);
            $success = JVB()->email()->sendPasswordResetEmail($user, $key);
         }
      }
@@ -710,26 +711,6 @@
      }
   }
   /**
    * Send password reset email (fallback if magic links not available)
    */
   protected function sendPasswordResetEmail(WP_User $user, string $key): bool
   {
      $reset_url = network_site_url(
         "wp-login.php?action=rp&key=$key&login=" . rawurlencode($user->user_login),
         'login'
      );
      $subject = 'Password Reset Request';
      $message = sprintf(
         "Hello %s,\n\nYou requested a password reset. Click the link below to reset your password:\n\n%s\n\nIf you didn't request this, please ignore this email.",
         $user->display_name,
         $reset_url
      );
      return wp_mail($user->user_email, $subject, $message);
   }
   protected function buildAuth(?int $user = null): array
   {
      if (is_user_logged_in()) {
@@ -759,9 +740,7 @@
      if (Features::forSite()->has('favourites')) {
         $nonces['favourites'] = wp_create_nonce('favourites-'.$userID);
      }
      if (Features::anyContentHas('karma') ||
         Features::anyTaxonomyHas('karma') ||
         Features::anyUserHas('karma')) {
      if (!empty(Registrar::getFeatured('karma'))) {
         $nonces['votes'] = wp_create_nonce('votes-'.$userID);
      }
      if (Features::forSite()->has('notifications')) {