davidgut/simple-auth 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

davidgut/simple-auth

最新稳定版本:v1.1.0

Composer 安装命令:

composer require davidgut/simple-auth

包简介

A simple authentication package for Laravel.

README 文档

README

A flexible, drop-in authentication package for Laravel applications, featuring Magic Links and standard Password authentication. No JavaScript required.

Features

  • Magic Link Authentication: Secure, passwordless login via email.
  • Password Authentication: Traditional email/password flow with Forgot Password functionality.
  • Security First: Rate limiting, timing attack protection, and secure URL signing.
  • Agnostic Views: Clean, unstyled Blade views (Tailwind-ready classes) that inherit your app's design.
  • Internationalization: Fully translatable UI strings.
  • Configurable: Extensive configuration for methods, redirects, and user models.

Installation

composer require davidgut/simple-auth

Configuration

To customize config/simple-auth.php, publish the configuration file:

php artisan vendor:publish --tag="simple-auth-config"

Views

To customize the login and signup pages, publish the views:

php artisan vendor:publish --tag="simple-auth-views"

Translations

To customize the text strings, publish the language files:

php artisan vendor:publish --tag="simple-auth-lang"

Assets

To ensure the login pages are styled correctly, publish the package assets (compiled Tailwind CSS):

php artisan vendor:publish --tag="simple-auth-assets"

Auth Methods

Environment Variables

You can configure the package by adding the following variables to your .env file:

SIMPLE_AUTH_DEFAULT_METHOD=password
SIMPLE_AUTH_MAGIC_LINK_ENABLED=true
SIMPLE_AUTH_MAGIC_LINK_TTL=15
SIMPLE_AUTH_PASSWORD_ENABLED=true
SIMPLE_AUTH_REDIRECT_AFTER_LOGIN=/
SIMPLE_AUTH_REDIRECT_AFTER_LOGOUT=/

Usage

Routes

The package registers the following routes automatically:

  • GET /login - Login page
  • POST /login/{method} - Process login
  • GET /signup - Signup page
  • POST /signup - Process signup
  • POST /logout - Logout
  • GET /forgot-password - Request password reset link
  • POST /forgot-password - Send password reset link
  • GET /reset-password/{token} - Reset password form
  • POST /reset-password - Update password

Views

The views are available at resources/views/vendor/simple-auth after publishing. They use standard Tailwind CSS classes and link to the published simple-auth.css.

Translations

All text strings are translatable. After publishing, you can find them in resources/lang/vendor/simple-auth.

Testing

Run the test suite:

./vendor/bin/pest

License

The MIT License (MIT).

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-16