Jake Vanderwerf
2026-01-20 7a9054bb3f033c98067b3196378311dae54c5fbf
inc/rest/routes/LoginRoutes.php
@@ -31,23 +31,7 @@
      register_rest_route($this->namespace, '/auth/login', [
         'methods' => 'POST',
         'callback' => [$this, 'handleLogin'],
         'permission_callback' => [$this, 'checkRateLimit'],
         'args' => [
            'user_email' => [
               'required' => true,
               'type' => 'string',
               'sanitize_callback' => 'sanitize_email'
            ],
            'user_password' => [
               'required' => true,
               'type' => 'string'
            ],
            'remember_me' => [
               'required' => false,
               'type' => 'boolean',
               'default' => false
            ]
         ]
         'permission_callback' => [$this, 'checkRateLimit']
      ]);
      // Logout endpoint
@@ -125,7 +109,8 @@
   public function handleLogin(WP_REST_Request $request): WP_REST_Response
   {
      $data = $request->get_json_params();
      $data = $request->get_params();
      error_log('Data: '.print_r($data, true));
      // Verify Turnstile
      if (!$this->verifyTurnstile($data['cf-turnstile-response'] ?? '')) {
         return $this->error('Security verification failed', 'turnstile_failed', 403);
@@ -584,7 +569,7 @@
      ];
   }
   protected function getRedirect(WP_User $user, string $url, string $context = 'login'):string
   protected function getRedirect(WP_User $user, ?string $url=null, string $context = 'login'):string
   {
      if (!empty($url)) {
         $url = sanitize_url($url);