MB Frontend Submission Upload Fails for Non-Admins -302 Redirect to wp-login.php
Support › MB Frontend Submission › MB Frontend Submission Upload Fails for Non-Admins -302 Redirect to wp-login.php
- This topic has 1 reply, 2 voices, and was last updated 1 month ago by
Peter.
-
AuthorPosts
-
July 20, 2025 at 5:00 PM #48583
Vincent Jollois
ParticipantI there,
I have a problem,i think since last MB update (the system was working before)
The Problem:
I have a front-end dashboard page where users with the 'Author' role can upload media to their galleries using an [mb_frontend_form] shortcode. However, the upload fails specifically for these 'Author' users.When they attempt to upload a file, the AJAX request to wp-admin/async-upload.php returns a 302 Found status, redirecting to wp-login.php. This effectively logs the user out and the upload never completes.
The process works perfectly when I am logged in as an Administrator, or when I use a plugin like "User Switching" to act as an Author from my admin account. The issue only occurs when logging in directly as an Author.
Environment:WordPress Version: [Mettez votre version de WP, ex: 6.5.5]
PHP Version: 8.2
Meta Box Version: 5.10.11
MB Frontend Submission Version: 4.5.2
Theme: Bricks Builder 1.12.4
Hosting: KinstaWhat I've Already Tried (Debugging Steps):
Role & Capabilities: I have confirmed using the "User Role Editor" plugin that the 'Author' role has the upload_files capability enabled.
Caching: We have aggressively ruled out caching issues.
Cloudflare: Page Rules are set to Bypass Cache for the dashboard page (/mon-espace-creatrice/) and the async-upload.php endpoint. The cf-cache-status header confirms this with DYNAMIC.
Kinsta: We have worked with Kinsta support to ensure these same pages and endpoints are excluded from all server-side caching (page cache, Edge Cache, etc.).
Nonce Fix: We have implemented a custom nonce fix in our theme's functions.php to handle the rwmb-upload-nonce. This code uses the check_admin_referer and wp_upload_handler_nonce_actions filters and is loaded very early.
Plugin Conflict Test: On a staging environment, I have disabled all plugins except for the Meta Box suite (Meta Box, MB Frontend Submission) and the Bricks theme. The issue still persists, which strongly suggests a core issue or a conflict with the theme.Recent Updates: This issue seems to have appeared after recent updates to the Meta Box plugins. It was working correctly in the earlier stages of development.
Given these steps, my questions are:
Is this a known issue with the latest versions of Meta Box or MB Frontend Submission, perhaps in combination with the Bricks theme?
Is our custom nonce fix (using check_admin_referer) still the correct approach, or has the recommended method for handling frontend uploads for non-admins changed?
Are there any other debugging steps you would recommend we take?
Any help or insight you can provide would be greatly appreciated. Thank you!July 21, 2025 at 10:39 PM #48588Peter
ModeratorHello Vincent,
What is the image/file field type that you used to allow the author to upload files? If you use the builder, please export the field group to a JSON file and share it with me
https://docs.metabox.io/extensions/meta-box-builder/#export--importI will import your field group to my site and try to reproduce the issue.
-
AuthorPosts
- You must be logged in to reply to this topic.