--- /dev/null
+<?php
+
+namespace App\Http\Controllers;
+
+class AdminController extends \Backpack\CRUD\app\Http\Controllers\AdminController
+{
+
+}
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Backpack\CRUD\app\Library\Auth\AuthenticatesUsers;
+use Laravel\Socialite\Facades\Socialite;
class LoginController extends Controller
{
use AuthenticatesUsers;
- /**
- * Where to redirect users after login.
- *
- * @var string
- */
- protected $redirectTo = RouteServiceProvider::HOME;
-
- /**
- * Create a new controller instance.
- *
- * @return void
- */
- public function __construct()
+ public function showLoginForm()
{
- $this->middleware('guest')->except('logout');
+ return Socialite::driver('google')->redirect();
}
}
namespace App\Models;
use Cubist\Backpack\Magic\Models\CubistMagicAuthenticatable;
+use Mpyw\NullAuth\NullAuthenticatable;
class User extends CubistMagicAuthenticatable
{
'singular' => 'utilisateur',
'plural' => 'utilisateurs',
'oneinstance' => false];
+
+ use NullAuthenticatable;
}
namespace App\Providers;
+use Cubist\Socialite\CubistSocialiteAuthServiceProvider;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
+use Mpyw\NullAuth\NullAuthServiceProvider;
-class AuthServiceProvider extends ServiceProvider
+class AuthServiceProvider extends CubistSocialiteAuthServiceProvider
{
/**
* The policy mappings for the application.
*/
public function boot()
{
- $this->registerPolicies();
-
- //
+ parent::boot();
}
}
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/cubist_socialite.git",
- "reference": "dc421ac208a9e1629c3109d7ee8b75fc97d61ba0"
+ "reference": "571d10f4238e9aeeb50e64813e774c651b97f333"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/cubist/socialite/cubist-socialite-dev-master-85af59.tar",
- "reference": "dc421ac208a9e1629c3109d7ee8b75fc97d61ba0",
- "shasum": "6195f23460211fa0564878e35d4f150ccea3c277"
+ "url": "https://composer.cubedesigners.com/dist/cubist/socialite/cubist-socialite-dev-master-9de216.tar",
+ "reference": "571d10f4238e9aeeb50e64813e774c651b97f333",
+ "shasum": "110ab3717c9b84168d157d58b93f3aa687d2d529"
},
"require": {
"laravel/framework": "~5.8|^6.0|^7.0|^8.0",
"laravel/socialite": "^v5.2.5",
+ "mpyw/null-auth": "^2.0",
"php": ">=7.3.0",
"socialiteproviders/google": "^4.1.0",
"spatie/laravel-permission": "^4.0"
"extra": {
"laravel": {
"providers": [
- "Cubist\\Socialite\\CubistSocialiteServiceProvider"
+ "Cubist\\Socialite\\CubistSocialiteServiceProvider",
+ "Cubist\\Socialite\\CubistSocialiteAuthServiceProvider"
]
}
},
"cubist",
"socialite"
],
- "time": "2021-10-07T17:24:38+00:00"
+ "time": "2021-10-07T18:33:55+00:00"
},
{
"name": "cubist/util",
],
"time": "2021-10-01T21:08:31+00:00"
},
+ {
+ "name": "mpyw/null-auth",
+ "version": "v2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/mpyw/null-auth.git",
+ "reference": "4cfe09067629b8856fc34f82418cb116acd42019"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/mpyw/null-auth/zipball/4cfe09067629b8856fc34f82418cb116acd42019",
+ "reference": "4cfe09067629b8856fc34f82418cb116acd42019",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/auth": "^6.0 || ^7.0 || ^8.0 || ^9.0",
+ "illuminate/contracts": "^6.0 || ^7.0 || ^8.0 || ^9.0",
+ "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0",
+ "php": "^7.3 || ^8.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "^2.14",
+ "mockery/mockery": "^1.3",
+ "orchestra/testbench": "^6.0",
+ "php-coveralls/php-coveralls": "^2.1"
+ },
+ "type": "library",
+ "extra": {
+ "laravel": {
+ "providers": [
+ "Mpyw\\NullAuth\\NullAuthServiceProvider"
+ ]
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Mpyw\\NullAuth\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "mpyw",
+ "email": "ryosuke_i_628@yahoo.co.jp"
+ }
+ ],
+ "description": "Null Guard for Laravel. Designed for Middleware-based authentication and testing.",
+ "keywords": [
+ "Dummy",
+ "auth",
+ "illuminate",
+ "laravel",
+ "none",
+ "nothing",
+ "null"
+ ],
+ "support": {
+ "issues": "https://github.com/mpyw/null-auth/issues",
+ "source": "https://github.com/mpyw/null-auth/tree/v2.0.0"
+ },
+ "time": "2021-01-25T08:58:33+00:00"
+ },
{
"name": "mxl/laravel-job",
"version": "v1.2.0",
'guards' => [
'web' => [
- 'driver' => 'session',
+ 'driver' => 'null',
'provider' => 'users',
],
],
'providers' => [
'users' => [
- 'driver' => 'eloquent',
+ 'driver' => 'socialitegoogle',
'model' => \App\Models\User::class,
],
--- /dev/null
+<?php
+
+/*
+|--------------------------------------------------------------------------
+| Backpack\Base Routes
+|--------------------------------------------------------------------------
+|
+| This file is where you may define all of the routes that are
+| handled by the Backpack\Base package.
+|
+*/
+
+Route::group(
+ [
+ 'namespace' => 'App\Http\Controllers',
+ 'middleware' => config('backpack.base.web_middleware', 'web'),
+ 'prefix' => config('backpack.base.route_prefix'),
+ ],
+ function () {
+ // if not otherwise configured, setup the auth routes
+ if (config('backpack.base.setup_auth_routes')) {
+ // Authentication Routes...
+ Route::get('login', 'Auth\LoginController@showLoginForm')->name('backpack.auth.login');
+ Route::post('login', 'Auth\LoginController@login');
+ Route::get('logout', 'Auth\LoginController@logout')->name('backpack.auth.logout');
+ Route::post('logout', 'Auth\LoginController@logout');
+
+ // Registration Routes...
+ Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('backpack.auth.register');
+ Route::post('register', 'Auth\RegisterController@register');
+
+ // if not otherwise configured, setup the password recovery routes
+ if (config('backpack.base.setup_password_recovery_routes', true)) {
+ Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('backpack.auth.password.reset');
+ Route::post('password/reset', 'Auth\ResetPasswordController@reset');
+ Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('backpack.auth.password.reset.token');
+ Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('backpack.auth.password.email');
+ }
+ }
+
+ // if not otherwise configured, setup the dashboard routes
+ if (config('backpack.base.setup_dashboard_routes')) {
+ Route::get('dashboard', 'AdminController@dashboard')->name('backpack.dashboard');
+ Route::get('/', 'AdminController@redirect')->name('backpack');
+ }
+
+ // if not otherwise configured, setup the "my account" routes
+ if (config('backpack.base.setup_my_account_routes')) {
+ Route::get('edit-account-info', 'MyAccountController@getAccountInfoForm')->name('backpack.account.info');
+ Route::post('edit-account-info', 'MyAccountController@postAccountInfoForm')->name('backpack.account.info.store');
+ Route::post('change-password', 'MyAccountController@postChangePasswordForm')->name('backpack.account.password');
+ }
+ });