bebeboutik-api/app/Web/Controllers/AuthController.php
Christophe LATOUR c88ea57ba5 Initial commit
2017-07-21 16:40:11 +02:00

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);
}
}