Skip to content

Login System and Notification Integration

IMHOFF GUILLAUME requested to merge feature/login_create into main

Merge Request: Login System and Notification Integration

Overview

This merge request introduces the login_create backend, along with a reusable Notification sprite for the Godot project. The changes include server-side security enhancements and user feedback mechanisms.

Backend Changes

Files Modified/Added

  • ./backend/database-handler/main.py: This is the main server-side file that needs to be executed. It handles the login and account creation logic.

Setup Instructions

  1. Create a Virtual Environment:
    • Ensure you create a .venv folder and activate it.
    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  2. Install Dependencies:
    • Install the required Python packages:
    pip install websockets psycopg2

Security Measures

  • SSL Certificate: The WebSocket link is secured using a self-signed SSL certificate.
  • Input Validation: The server validates email addresses using a regex pattern. If the email format is incorrect, the request will fail.
  • Duplicate Account Check: The server ensures that an account does not already exist before creating a new one.

Frontend Changes

Notification Sprite

  • Description: A Notification sprite has been introduced, which can be used across the Godot project to display user feedback.
  • Usage: Use Notification.show_side(message) to display a notification message to the user.
  • Purpose: This sprite is designed to notify users of errors during account creation or login, such as invalid email formats or duplicate accounts.

Testing

Backend Testing

  1. Run the main.py file on the server side.
  2. Ensure the WebSocket connection is established securely.
  3. Test login and account creation with various inputs, including invalid emails and duplicate accounts, to verify error handling.

Frontend Testing

  1. Integrate the Notification sprite into the Godot project.
  2. Trigger Notification.show_side(message) in different scenarios to ensure proper message display.

Conclusion

This merge request enhances the backend security and provides a consistent user feedback mechanism through the Notification sprite. Reviewers are encouraged to test both the backend and frontend changes thoroughly before merging.

Merge request reports