Login registration
Created by: KronosDP
This pull request includes several significant changes to the pom.xml
file and the addition of new classes and configurations for user authentication and security in the safetypin
project. The most important changes include the update of dependencies, the addition of new DTOs, controllers, models, exceptions, and security configurations.
Dependency Updates and Additions:
- Updated
junit-jupiter-api
tojunit-jupiter
and version to 5.11.2. - Added
org.postgresql:postgresql
dependency for runtime. - Added several Spring Boot dependencies including
spring-boot-starter-data-jpa
,spring-boot-starter-security
,h2
,spring-security-test
,spring-boot-starter-validation
, andspring-boot-starter-test
.
New Controllers and DTOs:
- Created
AuthenticationController
with endpoints for email and social registration, OTP verification, login, password reset, and a placeholder dashboard. - Added DTOs for
ErrorResponse
,PasswordResetRequest
,RegistrationRequest
, andSocialLoginRequest
to handle requests and responses.
Models and Repositories:
- Introduced
User
model with fields for email, password, name, verification status, role, birthdate, provider, and social ID. - Created
UserRepository
interface extendingJpaRepository
for database operations onUser
entities.
Security Configurations:
- Configured password encoding using
BCryptPasswordEncoder
inPasswordEncoderConfig
. - Set up security configurations in
SecurityConfig
to disable CSRF, allow all requests, and manage sessions statelessly.
Exception Handling:
- Added custom exceptions
InvalidCredentialsException
andUserAlreadyExistsException
for handling specific error cases.
These changes collectively enhance the authentication and security features of the application, ensuring better user management and secure handling of credentials.
Merge request reports
Activity
Please register or sign in to reply