There is no license information available for the latest version (v1.1) of this package.

Installs: 3

Dependents: 0

Suggesters: 1

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:saucebase-module

pkg:composer/saucebase/auth

v1.1 2025-10-30 20:28 UTC

This package is auto-updated.

Last update: 2025-10-30 20:30:39 UTC


README

Authentication module for Laravel with social login support.

Installation

Install via Composer:

composer require saucebase/auth
php artisan module:enable Auth

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

  1. 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
  1. Add the useSocialite trait 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 model
  • getConnectedProvidersAttribute() — Get list of connected OAuth providers
  • disconnectSocialProvider(string $provider) — Disconnect a social account
  • getLatestProviderAvatarUrlAttribute() — 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' => '...']]