|
|
@ -2,9 +2,9 @@ |
|
|
|
|
|
|
|
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\Http\Request; |
|
|
|
use Illuminate\Validation\Rule; |
|
|
@ -16,6 +16,7 @@ use Illuminate\Support\Facades\Cache; |
|
|
|
use Laravel\Lumen\Routing\Controller; |
|
|
|
use Laravel\Socialite\Facades\Socialite; |
|
|
|
use Illuminate\Session\TokenMismatchException; |
|
|
|
use phpDocumentor\Reflection\Location; |
|
|
|
use Symfony\Component\HttpFoundation\Response; |
|
|
|
|
|
|
|
class AuthController extends Controller |
|
|
@ -69,7 +70,7 @@ class AuthController extends Controller |
|
|
|
|
|
|
|
$user = User::where('email', $request->email)->first(); |
|
|
|
if ($user && Hash::check($request->password, $user->password)) { |
|
|
|
Auth::viaRequest('api', fn() => $user); |
|
|
|
Auth::setUser($user); |
|
|
|
|
|
|
|
return [ |
|
|
|
'auth' => $this->createFingerPrint(), |
|
|
@ -252,11 +253,11 @@ class AuthController extends Controller |
|
|
|
public function createFingerPrint() |
|
|
|
{ |
|
|
|
$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 = [ |
|
|
|