mirror of
https://github.com/pelican-dev/panel.git
synced 2026-03-01 11:21:31 +03:00
403 Invalid Signature #399
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mrhid6 on GitHub (Jul 30, 2025).
Current Behavior
When creating new users or resetting passwords, clicking the link in the email shows a 403 invalid signature.
There are no logs in the log folder.
https://panel.hostxtra.co.uk/password-reset/reset?email=<REDACTED>%40hotmail.co.uk&token=b2e4a61c7c4bd55bdf23cbdd98dde5c967139d7eff6fe5b895eeca571c9ce026&signature=9ff846c43925d4ef876f58dda761a995ce8d11c80fc2df9914f6ab5e6cd91d01Expected Behavior
The password reset form is meant to show.
Steps to Reproduce
Create a new user in the UI or API.
Click on the link in the email.
Or
Click on the password reset link on the login.
Click on the link in the email.
Panel Version
1.0.0-beta23
Wings Version
1.0.0-beta15
Games and/or Eggs Affected
No response
Docker Image
No response
Error Logs
Is there an existing issue for this?
@Jamesking56 commented on GitHub (Aug 3, 2025):
Is your app behind a proxy like Cloudflare by any chance?
@mrhid6 commented on GitHub (Aug 3, 2025):
@Jamesking56 yeah it’s behind cloudflare proxy and also a nginx reverse proxy
@Jamesking56 commented on GitHub (Aug 3, 2025):
Yeah, so basically what is happening is that Laravel is generating a URL and signing it using
http://and then you are hitting it onhttps://(due to Cloudflare or Nginx redirecting to HTTPS). Because of this redirect, it's causing the signature to no longer match (due to it being generated as http). I've had this a few times myself on other Laravel apps.To fix this, you need Laravel to generate links using HTTPS instead of HTTP. To do this in my apps, I created a custom middleware which checks the
X-Forwarded-Protoheader from Cloudflare to tell Laravel to use HTTPS for all URL generation.Not sure what the best way is to introduce this into Pelican. Whether we simply just add this middleware to Pelican by default or not:
@mrhid6 commented on GitHub (Aug 3, 2025):
So I did a bit of testing and logged the url that it generates to the larvel logs and it does produce a https url
It also matches the url in the email
@Jamesking56 commented on GitHub (Aug 3, 2025):
You can
dd()the signature that it produces and see if it matches what is expected, there's a built-in middleware that checks it. Might be worth verifying this.@mrhid6 commented on GitHub (Aug 3, 2025):
I’m not too familiar with PHP and laravel so not sure where this would go in the project
@Jamesking56 commented on GitHub (Aug 4, 2025):
Its this middleware in Laravel that checks if the signature matches:
https://github.com/laravel/framework/blob/12.x/src/Illuminate/Routing/Middleware/ValidateSignature.php
So you could stick a
dd()in there in yourvendor/laravel/frameworkdirectory of pelican and see if the signature matches and do more debugging that way.@mrhid6 commented on GitHub (Aug 4, 2025):
So, I managed to figure it out: When you have Cloudflare and proxy the DNS, then use an Nginx reverse proxy.
In the Pelican settings, you must add both the Cloudflare IPs and the IP of the nginx reverse proxy.
@AlphaCraft9658 commented on GitHub (Dec 16, 2025):
How do I use this or has this been implemented? I am using the Traefik Reverse proxy and Cloudflare Tunnels, but it works neither externally nor internally.
@Jamesking56 commented on GitHub (Dec 16, 2025):
@AlphaCraft9658
@AlphaCraft9658 commented on GitHub (Dec 16, 2025):
I will take a look at it, thanks!
I hope that this will possibly be implemented into the panel itself in the near future instead of requiring a manual fix.
@AlphaCraft9658 commented on GitHub (Dec 16, 2025):
I tried registering with
$middleware->append(ForceHttpsMiddleware::class);, but now I am getting error code 500.@Jamesking56 commented on GitHub (Dec 16, 2025):
Set
APP_DEBUG=truein.envand retry to see the full error message