saucebase/auth
最新稳定版本:v0.0.8
Composer 安装命令:
composer require saucebase/auth
包简介
README 文档
README
Authentication module for Sauce Base with social login support.
Installation
Install via Composer:
composer require saucebase/auth docker compose exec workspace php artisan module:enable Auth docker compose exec workspace php artisan module:migrate Auth --seed npm run build
Features
- User Authentication — Standard login, registration, and password reset flows
- Social Login — OAuth integration via Laravel Socialite (Google, GitHub, etc.)
- Social Account Linking — Connects multiple OAuth providers to a single user account
- Filament Integration — Admin panel components for user management
- Vue 3 Frontend — Pre-built authentication pages with Inertia.js
Configuration
Social Login Setup
- Configure OAuth providers in
.env:
GOOGLE_CLIENT_ID=your-client-id GOOGLE_CLIENT_SECRET=your-client-secret GOOGLE_CLIENT_REDIRECT_URI=/auth/socialite/google/callback GITHUB_CLIENT_ID=your-client-id GITHUB_CLIENT_SECRET=your-client-secret GITHUB_CLIENT_REDIRECT_URI=/auth/socialite/github/callback
- Add the
useSocialitetrait to your User model:
use Modules\Auth\Traits\useSocialite; class User extends Authenticatable { use useSocialite; // ... rest of your model }
The trait provides:
socialAccounts()— HasMany relationship to SocialAccount modelgetConnectedProvidersAttribute()— Get list of connected OAuth providersdisconnectSocialProvider(string $provider)— Disconnect a social accountgetLatestProviderAvatarUrlAttribute()— Get the most recent provider avatar URL
Usage
Authentication Routes
/auth/login— Login page/auth/register— Registration page/auth/forgot-password— Password reset request/auth/socialite/{provider}— OAuth redirect (google, github, etc.)/auth/socialite/{provider}/callback— OAuth callback
Service Usage
Handle OAuth callback:
use Modules\Auth\Services\SocialiteService; $user = app(SocialiteService::class)->handleCallback('google');
Disconnect a provider:
$user->disconnectSocialProvider('google');
Get connected providers:
$providers = $user->connected_providers; // Returns: [['provider' => 'google', 'last_login_at' => '...', 'provider_avatar_url' => '...']]
统计信息
- 总下载量: 50
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: Unknown
- 更新时间: 2025-10-30