-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor authentication controller and routes
- Updated localLogin and googleCallback functions in the authentication controller to remove unnecessary parameters and improve code readability. - Modified the response messages for successful login via local and Google authentication. - Added a new getStatus function to retrieve the user's status, including username and profile, if logged in. - Implemented a resetPassword function that returns a "Not implemented" message. Modified auth.routes.js: - Reordered the routes and added new routes for getStatus and resetPassword. Modified app.js: - Removed unused login and protected routes. - Removed the trust proxy setting. Modified corsOptions.js: - Updated the origin to use the FRONTEND_DOMAIN environment variable. - Enabled credentials for CORS. Modified sessionConfig.js: - Updated the secure option based on the NODE_ENV environment variable.
- Loading branch information
OomsOoms
committed
Sep 27, 2024
1 parent
1405378
commit ac1e7b6
Showing
5 changed files
with
29 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const cors = require('cors'); | ||
|
||
const corsOptions = { | ||
origin: ['https://localhost:3000', 'https://localhost:5500', 'https://s84dlvcl-8000.uks1.devtunnels.ms/'], | ||
optionSuccessStatus: 200, | ||
origin: process.env.FRONTEND_DOMAIN, | ||
credentials: true, | ||
}; | ||
|
||
module.exports = cors(corsOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters