|
@ -2,9 +2,9 @@ |
|
|
|
|
|
|
|
|
namespace App\Http\Controllers; |
|
|
namespace App\Http\Controllers; |
|
|
|
|
|
|
|
|
use App\User; |
|
|
|
|
|
use App\Business; |
|
|
|
|
|
use App\Fingerprint; |
|
|
|
|
|
|
|
|
use App\Models\User; |
|
|
|
|
|
use App\Models\Business; |
|
|
|
|
|
use App\Models\Fingerprint; |
|
|
use Illuminate\Support\Str; |
|
|
use Illuminate\Support\Str; |
|
|
use Illuminate\Http\Request; |
|
|
use Illuminate\Http\Request; |
|
|
use Illuminate\Validation\Rule; |
|
|
use Illuminate\Validation\Rule; |
|
@ -16,6 +16,7 @@ use Illuminate\Support\Facades\Cache; |
|
|
use Laravel\Lumen\Routing\Controller; |
|
|
use Laravel\Lumen\Routing\Controller; |
|
|
use Laravel\Socialite\Facades\Socialite; |
|
|
use Laravel\Socialite\Facades\Socialite; |
|
|
use Illuminate\Session\TokenMismatchException; |
|
|
use Illuminate\Session\TokenMismatchException; |
|
|
|
|
|
use phpDocumentor\Reflection\Location; |
|
|
use Symfony\Component\HttpFoundation\Response; |
|
|
use Symfony\Component\HttpFoundation\Response; |
|
|
|
|
|
|
|
|
class AuthController extends Controller |
|
|
class AuthController extends Controller |
|
@ -69,7 +70,7 @@ class AuthController extends Controller |
|
|
|
|
|
|
|
|
$user = User::where('email', $request->email)->first(); |
|
|
$user = User::where('email', $request->email)->first(); |
|
|
if ($user && Hash::check($request->password, $user->password)) { |
|
|
if ($user && Hash::check($request->password, $user->password)) { |
|
|
Auth::viaRequest('api', fn() => $user); |
|
|
|
|
|
|
|
|
Auth::setUser($user); |
|
|
|
|
|
|
|
|
return [ |
|
|
return [ |
|
|
'auth' => $this->createFingerPrint(), |
|
|
'auth' => $this->createFingerPrint(), |
|
@ -252,11 +253,11 @@ class AuthController extends Controller |
|
|
public function createFingerPrint() |
|
|
public function createFingerPrint() |
|
|
{ |
|
|
{ |
|
|
$attributes = [ |
|
|
$attributes = [ |
|
|
'agent' => \request()->getAgent(), |
|
|
|
|
|
'ip' => \request()->getClientIp(), |
|
|
|
|
|
'os' => \request()->getOS(), |
|
|
|
|
|
'latitude' => \request()->getLocation()->getAttribute('lat'), |
|
|
|
|
|
'longitude' => \request()->getLocation()->getAttribute('lon'), |
|
|
|
|
|
|
|
|
'agent' => request()->getAgent(), |
|
|
|
|
|
'ip' => request()->getClientIp(), |
|
|
|
|
|
'os' => request()->getOS(), |
|
|
|
|
|
'latitude' => 5, |
|
|
|
|
|
'longitude' => 5, |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
$values = [ |
|
|
$values = [ |
|
|