62 lines
1.2 KiB
PHP
62 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Web\Controllers;
|
|
|
|
use App\Models\User;
|
|
use Antadis\API\Front\Web\Controllers\AuthController as BaseAuthController;
|
|
use Illuminate\Http\Request;
|
|
|
|
use ApiCart;
|
|
|
|
class AuthController extends BaseAuthController
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function signin(Request $request)
|
|
{
|
|
global $cookie;
|
|
|
|
$user = parent::signin($request);
|
|
|
|
$cartModel = ApiCart::class;
|
|
|
|
$cookie->id_customer = $user->id;
|
|
$cookie->customer_lastname = $user->lastname;
|
|
$cookie->customer_firstname = $user->firstname;
|
|
$cookie->passwd = $user->passwd;
|
|
$cookie->logged = 1;
|
|
$cookie->id_currency = 1;
|
|
$cookie->email = $user->email;
|
|
$cookie->id_cart = ApiCart::lastNoneOrderedCart($user->id);
|
|
$cookie->write();
|
|
|
|
return $user;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function signout(Request $request)
|
|
{
|
|
return parent::signout($request);
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function signup(Request $request)
|
|
{
|
|
$user = parent::signup($request);
|
|
return $user;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function recover(Request $request)
|
|
{
|
|
return parent::recover($request);
|
|
}
|
|
}
|