WPIntell

Source evidence

Invalid request error message – Debugging

Magic Login – Passwordless Authentication for WordPress – Login Without Password · support · 2026-04-20T15:25:00+00:00

questionsentiment
mediumseverity
0.55relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

8 / 34 rows with source links

23.5% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
imokweb resolved
Hi there! Some users are intermittently encountering an ‘Invalid request’ error on the login form. Interestingly, after a browser refresh, they find themselves successfully logged in. I haven’t been able to replicate this locally, and I don’t see a built-in logging option within the plugin settings. I have enabled WP_DEBUG_LOG , but no relevant errors are being captured. What is the best way to debug this specific scenario? Are there specific hooks or hidden constants I can enable to track these ‘Invalid request’ instances? Thank you for your help! The page I need help with: [ log in to see the link] Hi @imokweb , Have you enabled AJAX mode? If so, and your site is using caching, this can explain the behavior you’re seeing. Magic Login uses nonces for AJAX requests, and if the page is cached for too long (for example 12+ hours), the nonce can expire while the cached page is still being served. In that case, users may see an “Invalid request” error, but after a refresh they get logged in because a fresh request with a valid nonce is generated. I’d recommend keeping the cache TTL under ~12 hours for the page where Magic Login is used, or excluding that page from cache entirely. Alternatively, you can switch to the non-AJAX method to avoid nonce-related issues. I hope this helps. Hi Mustafa! Thank you for the clarification — that makes sense. I’ve made a few adjustments based on your recommendations: Set the cache TTL to 11 hours Excluded /wp-admin/admin-ajax.php from cache Excluded the magic-login query string from caching Also excluded the /magic-login* URI to be safe Exclude settings: https://prnt.sc/qrp_aqYJcvTo TTL Settings: https://prnt.sc/KXYca_CBOCCP I’d prefer to keep the AJAX method enabled , since the login form is loaded globally (it appears in a popup when users click “My Account” in the header), so disabling AJAX and cache isn’t really ideal in this case. I’ll monitor things and see if these changes resolve the intermittent “Invalid request” issue. Thanks again for pointing me in the right direction! Hi @imokweb , You’re welcome, I’m happy to help. Let me know if the problem persists.

Comments

3 shown
Mustafa Uysal 2026-04-20T15:43:00+00:00

Hi @imokweb , Have you enabled AJAX mode? If so, and your site is using caching, this can explain the behavior you’re seeing. Magic Login uses nonces for AJAX requests, and if the page is cached for too long (for example 12+ hours), the nonce can expire while the cached page is still being served. In that case, users may see an “Invalid request” error, but after a refresh they get logged in because a fresh request with a valid nonce is generated. I’d recommend keeping the cache TTL under ~12 hours for the page where Magic Login is used, or excluding that page from cache entirely. Alternatively, you can switch to the non-AJAX method to avoid nonce-related issues. I hope this helps.

imokweb 2026-04-21T08:55:00+00:00

Hi Mustafa! Thank you for the clarification — that makes sense. I’ve made a few adjustments based on your recommendations: Set the cache TTL to 11 hours Excluded /wp-admin/admin-ajax.php from cache Excluded the magic-login query string from caching Also excluded the /magic-login* URI to be safe Exclude settings: https://prnt.sc/qrp_aqYJcvTo TTL Settings: https://prnt.sc/KXYca_CBOCCP I’d prefer to keep the AJAX method enabled , since the login form is loaded globally (it appears in a popup when users click “My Account” in the header), so disabling AJAX and cache isn’t really ideal in this case. I’ll monitor things and see if these changes resolve the intermittent “Invalid request” issue. Thanks again for pointing me in the right direction!

Mustafa Uysal 2026-04-21T12:31:00+00:00

Hi @imokweb , You’re welcome, I’m happy to help. Let me know if the problem persists.