Laravel Verify Email Address Issue - php

I have a problem with Laravel 5.7.22, I tried to activate the verification with the email and I get the message that:
A fresh verification link has been sent to your email address.
how it's properly working at least the part that send the emails with the verification link but when I click the generated link I get the following page:
I have tried to erase the project and reinstall it, and I also tried to generate the signature key with this command:
php artisan key:generate
that I have found in this other question, but that didn't work, I don't know what could be causing this issue.
I also tried to debug the the function hasValidSignature in the file UrlGenerator from Laravel, just because I read that it could help, but it doesn't make sense, I haven't event altered the middleware or something I'm just with the laravel routes that it generates by default.
The generated link looks something like this.
https://www.example.com/email/verify/1?expires=1548527438&signature=daebab97afbb2da6a0f37615bc3db7e59db9c59e704d185addcf88adf46e8f6d
I also have configured my .env file properly and the files under the config folder just for security.

Related

LdapRecord Laravel - Active Directory - does not see any users

I am using the ready package as a base, I have done all steps in the readme.md file and was able to login as "einstein" user. So all seems to be configured correctly.
Later I have changed the credentials for the ldap server, which is using Active Directory.
While runing command php artisan ldap:test i receive message that i was able to connect correctly. Laravel logs says the same, but I cannot log in to laravel app. While running the command php artisan ldap:import ldap get message that no users where find
In the log file i see something like this:
[2021-04-28 23:04:08] local.INFO: LDAP (ldap://domain.pl:389) - Operation: Search - Base DN: cn=username#domain.pl,ou=Users,dc=domain,dc=pl - Filter: (&(objectclass=top)(objectclass=person)(objectclass=organizationalperson)(objectclass=inetorgperson)(uid=username)) - Selected: (entryuuid,*) - Time Elapsed: 737.37
Have anyone had the same issue with the ldaprecord that he was able to connect to domain but wasn't able to authenticate to an app ? And was able to solve that ?
UPDATE: i've found that auth.php is using wrong User model, it was using OpenLdap not Active directory, changed that but result is still the same
Problem solved, to make it work with AD you need to:
in the auth.php file switch model to ActiveDirectory
in login controller change in the credentials function have to change 'uid' key to 'sameaccountname'

Laravel 7: How to edit the message in verification email

I am trying to edit Laravel default email verification message.
I have tried publishing the notification and mail resources.
php artisan vendor:publish --tag=laravel-notifications
php artisan vendor:publish --tag=laravel-mail
New folders called mail and notification were created in resource>views>vendor but I haven't been able to find the file which holds the codes for the message in either of the folders. I found a file that seems like the one in vendor>laravel>framework>src>Illuminate>Auth>Notification which is called VerifyEmail but I'm not sure if I'm suppose to change this file since I couldn't find any article online talking about this file.
My Laravel version is 7.15.0.
Any help would be appreciated as I have tried multiple methods with no success.
Thank you in advance.

Laravel 5.7 email verify broken link

I followed Laravels docs (link) about Email verification. Everything seems to work except for a 403 - invalid signature. This errors shows when clicking on the email link. I'm using shared hosting.
Url is similar to this:
[..]email/verify/21?expires=154270[..]&signature=920dcb9ac2fbf5[..]
would appreciate all the help I could get! Thanks!
Here is the answer: https://stackoverflow.com/a/44839664
You have to generate a key: php artisan key:generate

Why doesn't native Laravel 5.4 authentication send to password reset page?

I made a basic project in Laravel 5.4 using PhpStorm and executed php artisan make:auth and php artisan migrate. After running php artisan serve, I accessed the resulting site on http://localhost:8000 and tested the password recovery. Using Gmail for SMTP, the corresponding user received an e-mail with a link like this:
http://localhost/password/reset/d55b8591a690c96742e192d31ba6b1c7b06cb4b390fa08baaf02ce261618b884
It redirects me to a 404 Error page.
Looking at php artisan route:list, there is a route called "password.reset", set on GET|HEAD with the following URI: password/reset/{token}. So it seams that should work, since there is a place for a token. The action is: App\Http\Controllers\Auth\ResetPasswordController#showResetForm
There's basically nothing on that controller, but it has use ResetsPassword from Illuminate\Foundation\Auth inside the class. When I try to overwrite the function, I look at the original and it does redirect to reset password view.
But something is not working. I tried to add :8000 to the link, but it just redirects me to a blank page and I'm sure the server is still serving at that port. What am I doing wrong?
You have to change APP_URL=http://localhost to APP_URL=http://localhost:8000 in the .env
Your route in the email must have the ":8000" that is the port of your application. Your browser if looking for the same route but in just in the localhost route without a port

Laravel 5.3 url() function alway print http://localhost

I have just switch to new version of laravel i.e. 5.3 for my new project.
Once I need to send registration mail to my portal customer, where registration mail contains account activation link where this mail is sent using Mail::queue.
I am generating that link using url("activate/$random_string");
and which always prints http://localhost/activate/$random_string_value
but what i wants is,
http://localhost/project/public/activate/$random_string_value
or
http://192.168.0.45/laravel/public/activate/$random_string_value
(above result i am getting till laravel 5.2)
i have set APP_URL value in .env as well and in config/app.php as well,
I have tried php artisan config:clear and php artisan config:cache
Can anybody help me to sort out this issue. I have one possible solution is to use env('APP_URL') to genrate same url.
I think your url need to update like:
url("activate/".$random_string);
Hope this work for you!

Categories