Download the PHP package vancil/flint-auth without Composer

On this page you can find all versions of the php package vancil/flint-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flint-auth

flint-auth

Tests Total Downloads Latest Version on Packagist License

UI scaffold package for the Flint framework. Scaffolds session-based authentication with your choice of Bootstrap (server-rendered), Vue, or React frontend preset.

v2.0 — breaking change. The previous JWT API auth package has been replaced entirely. See the migration guide if you are upgrading.


Installation

Register the package in config/app.php:


Quick Start

Pick a frontend preset and add --auth to scaffold all authentication pages:

Then run your migrations and start the server:

Visit http://localhost:8000/register to get started.

For Vue/React presets, install JS dependencies and start the dev server:


What Gets Scaffolded

Running php flint ui <preset> --auth publishes the following into your application:

Migrations (database/migrations/)

Models (app/Models/)

Auth pages Route Description
GET /register Registration form
POST /register Create account + send verification email
GET /login Login form
POST /login Authenticate + start session
POST /logout End session
GET /forgot-password Request a password reset link
POST /forgot-password Send reset email
GET /reset-password/{token} Password reset form
POST /reset-password Apply new password
GET /email/verify "Please verify your email" notice
GET /email/verify/{token} Verify email address
POST /email/verify/resend Resend verification email
GET /dashboard Authenticated dashboard (protected by auth middleware)

Configconfig/auth.php and session/mail defaults written to .env.


Presets

Bootstrap

Server-rendered HTML using Flint's Spark template engine (.spark.php files). Bootstrap 5 is loaded from CDN — no build step required.

Controllers are published to app/Controllers/Auth/ and use Response::view(), Response::back(), and session flash for form repopulation.

Vue

Vite + Vue 3 SPA. Auth pages are Vue single-file components that call the JSON API endpoints (/api/auth/*) using fetch with credentials: 'include' so the session cookie is sent automatically.

React

Vite + React 18 SPA. Same JSON API approach as the Vue preset.


Auth in Controllers

The Flint\Auth\Auth class is available via constructor injection anywhere in your application:

Method Description
$auth->user() The authenticated user object, or null
$auth->check() true if a user is logged in
$auth->id() The authenticated user's ID
$auth->guest() true if no user is logged in
$auth->login($user, $remember) Log a user in; optionally set a 30-day remember-me cookie
$auth->logout() End the session and clear remember-me cookie

Protecting Routes

Use the built-in auth middleware alias (registered by Flint core) to restrict routes to authenticated users:

Unauthenticated visitors are automatically redirected to /login.


Mail (Password Reset & Email Verification)

Mail is handled by Flint's built-in mailer. Set your driver in .env:

Email templates are published to resources/views/emails/ and are plain .spark.php files you can customise freely.


Database

Three tables are created by the scaffolded migrations:

Table Purpose
users Registered users with optional email verification and remember-me support
password_reset_tokens Single-use tokens for password reset (expire after 1 hour)
email_verifications Single-use tokens for email address verification

Migrating from v1

v1 used JWT Bearer tokens for API authentication. v2 uses server-side sessions.

Removed: JwtMiddleware, RefreshMiddleware, RefreshToken model, auth:install command, firebase/php-jwt dependency, JWT_SECRET/JWT_ALGORITHM config.

Replaced with: Flint core Session, Csrf, and Auth classes — no extra package needed for the auth primitives themselves.

If you need to keep JWT for a pure API application, tag your v1 install and do not upgrade.


License

MIT — Vancil


All versions of flint-auth with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
vancil/flint Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vancil/flint-auth contains the following files

Loading the files please wait ...