Download the PHP package gusmanwidodo/auth-kit-credentials without Composer
On this page you can find all versions of the php package gusmanwidodo/auth-kit-credentials. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gusmanwidodo/auth-kit-credentials
More information about gusmanwidodo/auth-kit-credentials
Files in gusmanwidodo/auth-kit-credentials
Package auth-kit-credentials
Short Description Identifier + password login for Auth-Kit: register, login (email/phone/username + password), and forgot/reset password. Flexible single-identifier model, hashed passwords, single-use hashed reset tokens.
License MIT
Homepage https://github.com/gusmanwidodo/auth-kit-credentials
Informations about the package auth-kit-credentials
Auth-Kit Credentials
Identifier + password authentication for Auth-Kit: register, login (email / phone / username + password), and forgot / reset password. This is the fundamental credential login the ecosystem was missing.
Features
- Register with a flexible identifier (email / phone / username) + password.
- Login with any configured identifier type; passwords hashed via Laravel
Hash(bcrypt/argon per your app's config). - Forgot / reset password with single-use, expiring, hashed reset tokens.
- Timing-safe login — unknown identifiers still perform a hash comparison so response timing does not reveal whether an account exists.
- No user enumeration —
forgot-passwordresponds identically whether or not the identifier exists. - Composes with the rest of Auth-Kit: a registered subject can then get roles (permissions), join organizations/teams, and link social accounts.
See ADR 006.
Requirements
- PHP
^8.3 gusmanwidodo/auth-kit^0.1- Laravel 12
Installation
Endpoints
| Method | URI | Body |
|---|---|---|
| POST | /auth-kit/credentials/register |
{ identifier, password, type? } |
| POST | /auth-kit/credentials/login |
{ identifier, password, type? } |
| POST | /auth-kit/credentials/forgot-password |
{ identifier, type? } |
| POST | /auth-kit/credentials/reset-password |
{ identifier, token, password, type? } |
type is one of the configured identifier_types (default email; also
phone, username). Omit it to use the default.
Usage
Linking a subject (optional)
By default a credential stores its own identity. To attach it to your User model,
resolve the subject in a before:credentials.register hook:
login() then returns the linked subject_type / subject_id, which your app
uses to Auth::login() the user.
Hooks
| Event | When | Notes |
|---|---|---|
before:credentials.register |
Before creating a credential | Set subject_type/subject_id to link |
after:credentials.register |
After creation | — |
before:credentials.login |
Before returning success | Set allow=false to veto (e.g. locked account) |
after:credentials.login |
On successful login | — |
after:credentials.forgot |
After a reset token is issued | Deliver the token here if you prefer |
after:credentials.reset |
After a successful reset | — |
Security notes
- Passwords hashed with Laravel
Hash(never stored plaintext;password_hashis hidden from serialization). - Reset tokens are random 64-char strings; only their hash is stored, and
they are single-use and time-limited (
reset_ttl, default 1 hour). - Login is timing-safe against unknown identifiers.
forgot-passwordnever reveals whether an identifier exists.- Password delivery (reset email/SMS) is the app's responsibility.
Config
config/auth-kit-credentials.php:
Developing against a local core
Note:
composer require :@devrewrites this composer.json to@dev. Revert thegusmanwidodo/auth-kitconstraint to^0.1and remove anyrepositoriesblock before committing/tagging a release.
License
MIT © Gusman Widodo. See LICENSE.
All versions of auth-kit-credentials with dependencies
gusmanwidodo/auth-kit Version ^0.1
illuminate/contracts Version ^12.0
illuminate/database Version ^12.0
illuminate/support Version ^12.0