Commit Graph

18 Commits

Author SHA1 Message Date
63cebef027 feat: add remember me functionality to login
- Implement remember me checkbox in login form
- Update sessions controller to handle remember me logic
- Enhance session management to prevent session hijacking
- Add tests for remember me functionality

This commit introduces a "Remember me" feature that allows users to
stay logged in across sessions. It includes updates to the login
form, session handling in the controller, and additional tests to
ensure the functionality works as expected. The changes also
improve security by validating session tokens to prevent session
hijacking.
2025-01-02 17:49:06 +08:00
f110f26c0b fix: ensure user logout only if logged in
- Update `destroy` action in `SessionsController` to log out
  only if the user is currently logged in.
- Add a check in the `authenticated?` method of the `User`
  model to return false if `remember_digest` is nil.
- Enhance integration tests to simulate logout in another
  browser session and verify that the logout link is not
  present after logging out.

These changes improve the robustness of the session management
by preventing unnecessary logout attempts and ensuring that
authentication checks are more reliable.
2025-01-02 17:17:09 +08:00
ccd6b02a98 feat: add remember me functionality for user sessions
- Implement remember method in User model to generate and store a remember token
- Update SessionsController to call remember on successful login
- Enhance current_user method to retrieve user from cookies if session is not present
- Add forget method to clear remember token on logout
- Create migration to add remember_digest column to users table
2025-01-02 16:47:26 +08:00
a69a4a5177 fix: correct typos and improve logout link
- Change "Log out" link to use `data: { turbo_method: :delete }`
- Update "Login in" to "Log in" for consistency
- Fix typo in sign-up prompt from "SIgn up now!" to "Sign up now!"
- Ensure proper indentation in error messages partial
- Add turbo frame to user signup form for better performance
- Adjust routes for consistency by adding leading slashes

These changes enhance the user interface by correcting typographical errors and improving the logout functionality. The use of turbo frames in the signup form aims to optimize the user experience during account creation.
2025-01-02 15:17:27 +08:00
d795de6aa1 feat: update asset management and add bundling tools
- Add cssbundling-rails and jsbundling-rails gems for improved
  asset management.
- Create a Procfile for development with separate processes for
  CSS and JS.
- Remove unused jQuery and Bootstrap assets from the
  application.
- Update .gitignore to exclude build artifacts and node_modules.

These changes streamline the asset pipeline, allowing for
better organization and performance in handling CSS and JS
files. The removal of unused assets reduces clutter and
potential conflicts in the asset management process.
2025-01-02 14:45:44 +08:00
bd5c6ae6bb feat: enhance user session management
- Update session creation to use safe navigation operator
- Implement log_out method in SessionsHelper
- Add session reset and login on user creation
- Improve user login tests for better coverage

These changes improve the user session management by ensuring
that the session is handled more safely and efficiently. The
addition of the log_out method centralizes session termination,
while the updated tests ensure that both login and logout
functionality are thoroughly validated.
2025-01-02 11:59:27 +08:00
cd4239ce17 feat: improve responsive header navigation
- Add a toggle button for collapsing the navbar
- Change the structure of the navbar to ensure it is responsive

This enhancement allows the navigation bar to be more user-friendly
on mobile devices, enabling easy access to navigation links while
saving screen space. The toggle button helps in collapsing or
expanding the menu as needed.
2025-01-02 09:11:42 +08:00
8baa51f611 feat(sample): add session and header 2025-01-01 15:44:50 +08:00
9fac43f46d feat: add user registration functionality
- Implement user creation in UsersController
- Add user registration form in new.html.erb
- Create error messages partial for form validation
- Add gravatar helper for user profile
- Update routes to include resources for users
- Introduce integration tests for signup validation

This commit establishes the foundation for user registration, allowing users to sign up with their details and providing feedback on form errors. It enhances the user experience by integrating visual elements like gravatars and error messages.
2024-12-31 16:34:52 +08:00
cd558466be feat: add user registration functionality
- Add User model with validations for name and email
- Implement UsersController with new action for signup
- Create views for user signup and home page
- Update routes to include signup path
- Add bcrypt gem for password security
- Include tests for user model and controller actions

This commit establishes the foundation for user registration in the application, ensuring proper validation and security measures are in place. It also enhances the user experience by providing a dedicated signup page.
2024-12-31 14:20:22 +08:00
02b7393ed4 add some test 2024-12-31 00:37:02 +08:00
2d8a32478c style: reorganize styles into custom.scss
- Moved universal styles, typography, header, and footer styles
  from application.scss to custom.scss for better organization.
- Introduced SCSS variables for colors to enhance maintainability.
- Updated the hover state for the logo and footer links to use
  the new color variable.

This change improves the structure of the stylesheets, making it
more manageable and easier to maintain in the future.
2024-12-30 18:09:54 +08:00
a91fc8f729 feat: add header and footer layout components
- Implement header and footer partials for better layout
- Create a full_title helper method for dynamic page titles
- Update application layout to use new header and footer
- Add typography styles for improved text presentation

These changes enhance the overall structure of the application by
introducing reusable header and footer components, which improves
maintainability. The full_title helper method allows for dynamic
titles across different pages, providing a consistent user
experience. Additionally, typography styles have been added to
improve readability and aesthetics.
2024-12-30 17:54:42 +08:00
12e39e2eb4 import bootstrap 2024-12-30 17:24:18 +08:00
575fb2e2d6 add website struct 2024-12-30 13:23:22 +08:00
22b1e769b2 finish 2024-12-30 00:09:54 +08:00
7ee9afebe0 add static pages 2024-12-29 17:22:48 +08:00
5bd0c44c91 init sample-app 2024-12-29 17:12:54 +08:00