Skip to content

Commit

Permalink
fix: redirection url updates
Browse files Browse the repository at this point in the history
  • Loading branch information
amitHarwani committed Apr 26, 2024
1 parent 67c9baf commit 3e4dec4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This is an ecommerce client app which is made by consuming freeapi: https://gith
* MAILTRAP credentials for emails. (Used in forgot password feature)
* Paypal Client ID and Client Secret.
* Google SSO Credentials for logging in with google.
* In .env, Set CLIENT_SSO_REDIRECT_URL to <FRONT_END_ENDPOINT>/ for redirects after logging in from google. example http://localhost:3000/
* Update the following in the freeapi project:
* Add an environment variable in .env file for forgot password redirection, and point it to the <FRONT_END_ENDPOINT>/forgot-password, as follows:
```FORGOT_PASSWORD_REDIRECT_URL=http://localhost:3000/forgot-password```
Expand Down
4 changes: 1 addition & 3 deletions src/controllers/apps/auth/user.controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,7 @@ const forgotPasswordRequest = asyncHandler(async (req, res) => {
// ! NOTE: Following link should be the link of the frontend page responsible to request password reset
// ! Frontend will send the below token with the new password in the request body to the backend reset password endpoint
// * Ideally take the url from the .env file which should be teh url of the frontend
`${req.protocol}://${req.get(
"host"
)}/api/v1/users/reset-password/${unHashedToken}`
`${process.env.FORGOT_PASSWORD_REDIRECT_URL}/${unHashedToken}`
),
});
return res
Expand Down

0 comments on commit 3e4dec4

Please sign in to comment.