busao
    Preparing search index...

    Function handleLogin

    • Handles the authentication logic.

      Parameters

      • i18n: i18n

        The internationalisation object.

      • request: BunRequest

        The request to the associated endpoint.

      • database: BunSQLiteDatabase

        The project's database.

      • maxSeats: number

        The maximum amount of seats of the vehicle.

      • route: string

        The API route for user search in the tables.

      • date: Date

        The current date.

      • adminPassword: string

        The instance's admin password.

      Returns Promise<Response>

      • An error message in case no password is provided.
      • An error message in case the submitted password exceeded the limit.
      • A redirect to the "Admin" page in case the admin gets the password right.

      Adds a session cookie on successful login, to skip the login page.