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

Implementig cors #79

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Implementig cors #79

wants to merge 14 commits into from

Conversation

Katzzer
Copy link

@Katzzer Katzzer commented Oct 14, 2024

No description provided.

Katzzer and others added 14 commits September 11, 2024 22:30
Modified the `application.yml` and `docker-compose.yml` files to use 'postgres' as the database username and password. Also changed the JPA hibernate `ddl-auto` configuration from 'create-drop' to 'update' for better consistency during development.
Incorporated PostgreSQL service to the GitHub Actions workflow for building Docker images. The setup ensures the database is ready before Maven builds, supporting integration tests. Adjusted formatting and fixed Java version specification.
Introduce a Dockerfile to containerize a Java application using OpenJDK 17 on Alpine Linux. The Dockerfile copies the JAR file from the build artifacts and sets the entry point to run the application.
Updated the ARG JAR_FILE to eliminate the 'api/' prefix, ensuring consistency with the copy command. Also added spacing in ENTRYPOINT for better readability.
Implemented a check to verify if a user with the same email already exists during registration. If a duplicate user is detected, a custom exception is thrown and an appropriate error message is returned to the client.
Updated the docker-compose.yml to use version 3.8. Added a new service named 'food-app' with its necessary configuration, including environment variables, ports, networks, dependencies, and restart policy.
Integrated the `@Slf4j` annotation to enable logging in `AuthenticationService.java` and `SecurityApplication.java`. Logging now captures user existence checks and registration token creation, replacing print statements with log entries.
Updated project version in pom.xml to 0.0.2-SNAPSHOT. Added logs to indicate the creation of 'Admin' and 'Manager' users in SecurityApplication.java. Corrected the manager's first and last name in the registration request.
Updated the `register` method in `AuthenticationController` to set the user role to `USER` by default. This ensures that all new users are assigned the `USER` role upon registration.
This commit introduces a new CorsConfig class to manage Cross-Origin Resource Sharing (CORS) settings. It allows credentials, supports all headers and methods, and specifically allows requests from "http://localhost:3000". This enhances security and flexibility in handling CORS requests.
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.

2 participants