Merged updates from other projects
This commit is contained in:
43
app/Console/Commands/GenerateCode.php
Normal file
43
app/Console/Commands/GenerateCode.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Clarkeash\Doorman\Facades\Doorman;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class GenerateCode extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'code:generate {email}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Generate an Access Code for email';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
echo Doorman::generate()->for($this->argument('email'))->expiresIn(14)->make();
|
||||
}
|
||||
}
|
@@ -39,4 +39,4 @@ class Kernel extends ConsoleKernel
|
||||
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
}
|
34
app/Http/Controllers/Auth/SocialLoginController.php
Normal file
34
app/Http/Controllers/Auth/SocialLoginController.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Socialite;
|
||||
|
||||
class SocialLoginController extends Controller
|
||||
{
|
||||
public function redirectToProvider($provider)
|
||||
{
|
||||
return Socialite::with($provider)->redirect();
|
||||
}
|
||||
|
||||
public function handleProviderCallback($provider)
|
||||
{
|
||||
$openiduser = Socialite::with($provider)->user();
|
||||
|
||||
$user = Socialite::with($provider)->findOrCreateUser($openiduser);
|
||||
|
||||
Auth::login($user,FALSE);
|
||||
|
||||
/*
|
||||
if (! $user->profile_update)
|
||||
{
|
||||
return redirect()->to(url('settings'));
|
||||
}
|
||||
*/
|
||||
|
||||
return redirect()->intended();
|
||||
}
|
||||
}
|
28
app/Http/Controllers/SearchController.php
Normal file
28
app/Http/Controllers/SearchController.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\{Group,Product};
|
||||
|
||||
class SearchController extends Controller
|
||||
{
|
||||
use \App\Traits\GetImportDate;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function search(Request $request)
|
||||
{
|
||||
$result = [];
|
||||
|
||||
return json_encode($result);
|
||||
}
|
||||
}
|
@@ -50,4 +50,4 @@ class User extends Authenticatable
|
||||
{
|
||||
return $this->firstname.' '.$this->lastname;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user