Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Send $url (set in .env) to forgetPassword template from UserController::forgetPassword() #82 #108

Merged
merged 3 commits into from
Dec 25, 2023

Conversation

FranEnLaNube
Copy link
Collaborator

@FranEnLaNube FranEnLaNube commented Nov 29, 2023

Description

This is my contribution to the solution implemented by @brycoti in #103.
To resolve #82 I've made the following changes:

  • The idea is to be able to change the URL from the .env file and not be forced to harcode it in the template.

Changes

  • I've changed UserController::forgetPassword() to send $url instead of $token to the template.
    • $url is set with this approach: $url = env('APP_URL') . '/reset-password/' . $token;
  • Then I changed the construct in app\Mail\ForgetPasswordMail.php to receive $url instead of $token
  • Lastly I set href="{{$url}}".... in forgetPassword.blade.php.

@FranEnLaNube FranEnLaNube self-assigned this Nov 29, 2023
Copy link
Collaborator

@brycoti brycoti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It allows you to easily update the URL without modifying the code directly, making application more adaptable to different environments or changes in the URL structure. This change has been a valuable learning experience for me, particularly in understanding the importance of adaptable solutions for different environments and the benefits of using environmental configuration for sensitive information. Thanks you so much!

@FranEnLaNube FranEnLaNube changed the title Fix/Send $url (set in .env) to forgetPassword template from UserController::forgetPassword() Fix/Send $url (set in .env) to forgetPassword template from UserController::forgetPassword() #82 Nov 30, 2023
Copy link

sonarcloud bot commented Dec 19, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@FranEnLaNube
Copy link
Collaborator Author

I added the default URL in the $url variable in UserController.php L102. In case it's not set in the .env file

@SectionOne
Copy link
Collaborator

Perfecte tots els canvis els veig correctament implementats.

@SectionOne SectionOne merged commit 6ddca3f into develop Dec 25, 2023
1 check passed
@FranEnLaNube FranEnLaNube deleted the hotfix/reset-password-link branch December 29, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] Mail reset password
3 participants