Description : Implement "Remember Me" Functionality
To improve the user experience for returning users, a "Remember Me" feature should be added to the login form. When a user selects this option, their session should persist across browser sessions, so they do not have to log in every time they visit the application.
Tasks
- Add "Remember Me" Checkbox: Add a "Remember Me" checkbox to the
Login.jsx component.
- Update Authentication Logic: Modify the
authService to use localStorage instead of sessionStorage when the "Remember Me" option is selected. This will persist the JWT token across browser sessions.
- Handle Token Expiration: Ensure that the application gracefully handles expired tokens. If a persisted token is expired, the user should be redirected to the login page.
- Backend Consideration (Optional): The backend could be updated to issue a longer-lived JWT when "Remember Me" is selected, but this is not strictly necessary for the initial implementation.
Acceptance Criteria
- A "Remember Me" checkbox is present on the login form.
- When checked, the user remains logged in after closing and reopening the browser.
- When unchecked, the user is logged out after the browser session ends.
Description : Implement "Remember Me" Functionality
To improve the user experience for returning users, a "Remember Me" feature should be added to the login form. When a user selects this option, their session should persist across browser sessions, so they do not have to log in every time they visit the application.
Tasks
Login.jsxcomponent.authServiceto uselocalStorageinstead ofsessionStoragewhen the "Remember Me" option is selected. This will persist the JWT token across browser sessions.Acceptance Criteria