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

Dev 1 #7

Merged
merged 7 commits into from
Mar 31, 2024
Merged

Dev 1 #7

merged 7 commits into from
Mar 31, 2024

Conversation

arkajyotiadhikary
Copy link
Owner

No description provided.

This commit implements functionality to generate and manage user session IDs, refresh tokens, and access tokens. It includes the following changes:

- Implement logic to generate unique session IDs for each user upon login.
- Generate refresh tokens to allow users to obtain new access tokens without requiring reauthentication.
- Generate short-lived access tokens with limited scope for user authentication and authorization.

These changes enhance security and improve user experience by providing a mechanism for managing user sessions and ensuring secure access to protected resources.
This commit addresses the following issues:
- Fixed an error in the environment file that was causing configuration inconsistencies.
- Added color formatting to console logs for improved readability and debugging.

Changes:
- Updated the environment configuration to resolve the error related to missing or incorrect variables.
- Implemented color-coded console log messages to differentiate between different types of logs and improve debugging efficiency.

These changes ensure a more robust and user-friendly development environment, enhancing the reliability and readability of the codebase.
This commit introduces functionality to store access tokens, refresh tokens, and session IDs for users, enhancing authentication and session management capabilities. It also includes modifications to the user model to accommodate these changes.

Changes:
- Implement logic to store access tokens, refresh tokens, and session IDs for users upon login.
- Update the user model to include fields for storing these tokens and identifiers.
- Enhance authentication endpoints to return access tokens, refresh tokens, and session IDs during login.
- Adjust database schema or data storage mechanism to accommodate the new fields in the user model.

These changes improve the security and functionality of the authentication system, enabling better management of user sessions and access control within the application.
This commit introduces an admin client upload form allowing users with administrative privileges to upload music data. Additionally, a list of songs has been implemented to display the uploaded songs. This enhances the functionality of the application and provides administrators with the ability to manage music content.
Describe the problem and steps taken to resolve it:
- Investigated why the auth token wasn't being set in response headers
- Checked backend configuration and response headers
- Confirmed CORS settings allow the Authorization header
- Considered using a custom header as a workaround

This commit addresses the issue and ensures the auth token is correctly set in the response headers.
@arkajyotiadhikary arkajyotiadhikary merged commit 5e968fe into master Mar 31, 2024
0 of 3 checks passed

const router = Router();

// Route to get all songs
router.get("/songs", getAllSongs);
router.get("/songs", authenticateUser, getAllSongs);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.

// Route to get a specific song by ID
// router.get("/songs/:id", getSongByID);

// Route to search songs
router.get("/songs/search", searchSongs);
router.get("/songs/search", authenticateUser, searchSongs);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.

// Route to get popular songs
router.get("/songs/popular", searchSongsByPopularity);
router.get("/songs/popular", authenticateUser, searchSongsByPopularity);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.

// Route to render song upload form
router.get("/upload", (req: Request, res: Response) => {
res.render("SongUploadForm.view.ejs");
});

// Route to handle song upload
router.post("/upload", createSong);
router.post("/upload", authenticateAdmin, createSong);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.

// Route to update a song
router.put("/songs/:id", updateSong);
router.put("/songs/:id", authenticateAdmin, updateSong);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.

// Route to delete a song
router.delete("/songs/:id", deleteSong);
router.delete("/songs/:id", authenticateAdmin, deleteSong);

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
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.

1 participant