Authentication Overview

This section provides an overview of the user authentication features implemented in the system, covering user registration, login/logout, password management, and email verification.

Key Functionalities

User Registration

  • Endpoints:
    • GET /register: Displays the user registration form.
    • POST /register: Processes new user registration.
  • Requirements: Users must provide a name, a unique email address, and a password (minimum 8 characters, confirmed).
  • Initial State: Upon registration, the user's email_verified_at field is set to null, indicating that email verification is required.

User Login and Logout

  • Endpoints:
    • GET /login: Displays the login form.
    • POST /login: Authenticates user credentials.
    • POST /logout: Logs out the authenticated user.
  • Login Requirements: Users must provide their email and password.
  • Session Management: Handles secure session creation upon login and invalidation/regeneration upon logout.

Password Management

  • Endpoints:
    • GET /forgot-password: Displays the form to request a password reset link.
    • POST /forgot-password: Sends a password reset link to the provided email address.
  • Rate Limiting: Implements rate limiting to prevent abuse of the password reset functionality.

Reset Password (Set New Password)

  • Endpoints:
    • GET /reset-password/{token}: Displays the form to set a new password using a reset token.
    • POST /reset-password: Processes the new password submission.
  • Requirements: Users must provide their email, a new password (minimum 8 characters, confirmed), and the token received in the reset email.

Update Password (Authenticated User)

  • Endpoint: PUT /password
  • Requirements: Authenticated users can update their password by providing their current_password and a new password (minimum 8 characters, confirmed).

Password Confirmation

  • Endpoint: GET /confirm-password (and POST /confirm-password)
  • Purpose: For sensitive actions, users are required to re-enter their password to confirm their identity for a limited time.

Email Verification

Email Verification Prompt

  • Endpoint: GET /verify-email
  • Purpose: Displays a prompt to the user if their email address has not yet been verified.

Send Email Verification Notification

  • Endpoint: POST /email/verification-notification
  • Purpose: Allows users to request a new email verification link if the previous one has expired or was not received.
  • Rate Limiting: Implements rate limiting for sending verification emails.

Verify Email

  • Endpoint: GET /verify-email/{id}/{hash}
  • Purpose: Handles the actual email verification process when a user clicks the link in the verification email. It marks the user's email as verified.

Inferred Specifications

  • Standard Authentication Flow: The system implements a standard web authentication flow, including user registration, login, logout, and password management.
  • Password Security: Passwords are hashed and require a minimum length of 8 characters, with confirmation during creation and reset.
  • Email-Based User Identification: User accounts are primarily identified by their unique email addresses.
  • Email Verification: A mandatory email verification step is in place for new user registrations, enhancing security and ensuring valid contact information.
  • Rate Limiting: Critical authentication actions (password reset, email verification notification) are protected by rate limiting to mitigate abuse and brute-force attacks.
  • Session Security: Proper session management practices are followed, including session invalidation and token regeneration upon logout or sensitive actions.
  • Password Confirmation for Sensitive Actions: The system employs a password confirmation mechanism for actions requiring an elevated level of trust or security.

Vous n'avez pas envie de la manager ?

Découvrir notre offre PKI As A Service