[GH-ISSUE #355] APP_URL #856

Closed
opened 2026-03-14 10:55:22 +03:00 by kerem · 1 comment
Owner

Originally created by @muxo771 on GitHub (Oct 31, 2022).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/355

The APP_URL has to be set to a real address.

Had setup a test system with a non-default port for the webserver.

Always got a 403 bad signature for the verification email, because I added the port number by hand.

After some search I found a hint how the system creates the verification email.
https://stackoverflow.com/questions/53892356/laravel-5-7-signed-route-returns-403-invalid-signature


UNDERSTANDING LARAVEL EMAIL VERIFICATION WAY

Understanding the way of verification can help you simply solve this error.
laravel makes a temporary signed url using method URL::temporarySignedRoute(),
this method is called in verificationUrl() located at \vendor\laravel\framework\src\Illuminate\Auth\Notifications\VerifyEmail.php.

So if the url that sent to emails is different from url that will laravel get at the time of verification (time of checking signature of url), 403 | invalid signature occurs.

Example:

if you set APP_URL to http://yourdomain.com/, verification link should be look like http://yourdomain.com/email/verify/{id}/{hash}. now if you set your server configs to redirect to https, invalid signature will occured, since the url laravel gets is https://yourdomain.com/email/verify/{id}/{hash} and not same as email verification url.


After putting the port number also in the .env I could verify the test account.

Could be helpful to explain it on the comment line, like has to be the complete url(:port) or verification will fail.

or

The URL of the AnonAddy instance, can be anything you like e.g. aa.example.com(:port), or just example.com(:port)

kind regards

Originally created by @muxo771 on GitHub (Oct 31, 2022). Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/355 The APP_URL has to be set to a real address. Had setup a test system with a non-default port for the webserver. Always got a 403 bad signature for the verification email, because I added the port number by hand. After some search I found a hint how the system creates the verification email. https://stackoverflow.com/questions/53892356/laravel-5-7-signed-route-returns-403-invalid-signature *********************************** UNDERSTANDING LARAVEL EMAIL VERIFICATION WAY Understanding the way of verification can help you simply solve this error. laravel makes a temporary signed url using method URL::temporarySignedRoute(), this method is called in verificationUrl() located at \vendor\laravel\framework\src\Illuminate\Auth\Notifications\VerifyEmail.php. So if the url that sent to emails is different from url that will laravel get at the time of verification (time of checking signature of url), 403 | invalid signature occurs. Example: if you set APP_URL to http://yourdomain.com/, verification link should be look like http://yourdomain.com/email/verify/{id}/{hash}. now if you set your server configs to redirect to https, invalid signature will occured, since the url laravel gets is https://yourdomain.com/email/verify/{id}/{hash} and not same as email verification url. ************************************** After putting the port number also in the .env I could verify the test account. Could be helpful to explain it on the comment line, like has to be the complete url(:port) or verification will fail. or The URL of the AnonAddy instance, can be anything you like e.g. aa.example.com(:port), or just example.com(:port) kind regards
kerem closed this issue 2026-03-14 10:55:28 +03:00
Author
Owner

@willbrowningme commented on GitHub (Nov 1, 2022):

Thanks, I've updated the comment to mention the port too.

<!-- gh-comment-id:1298370539 --> @willbrowningme commented on GitHub (Nov 1, 2022): Thanks, I've updated the comment to mention the port too.
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/anonaddy#856
No description provided.