Login System and Notification Integration
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
-
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
- Ensure you create a
-
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
- Run the
main.py
file on the server side. - Ensure the WebSocket connection is established securely.
- Test login and account creation with various inputs, including invalid emails and duplicate accounts, to verify error handling.
Frontend Testing
- Integrate the
Notification
sprite into the Godot project. - 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.