Commit 87f238ed authored by Nicolas Widart's avatar Nicolas Widart

Merge commit '97214232'

* commit '97214232':
  Squashed 'Modules/User/' changes from 4417311..0fb1cbc
parents 222ec0a0 97214232
......@@ -4,13 +4,13 @@ use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
use Laracasts\Commander\CommanderTrait;
use Laracasts\Flash\Flash;
use Modules\Core\Contracts\Authentication;
use Modules\User\Exceptions\InvalidOrExpiredResetCode;
use Modules\User\Exceptions\UserNotFoundException;
use Modules\User\Http\Requests\LoginRequest;
use Modules\User\Http\Requests\RegisterRequest;
use Modules\User\Http\Requests\ResetCompleteRequest;
use Modules\User\Http\Requests\ResetRequest;
use Modules\User\Repositories\AuthenticationRepository;
class AuthController
{
......@@ -21,7 +21,7 @@ class AuthController
*/
private $auth;
public function __construct(AuthenticationRepository $auth)
public function __construct(Authentication $auth)
{
$this->auth = $auth;
}
......
......@@ -83,8 +83,8 @@ class UserServiceProvider extends ServiceProvider
'Modules\User\Repositories\Sentinel\SentinelRoleRepository'
);
$this->app->bind(
'Modules\User\Repositories\AuthenticationRepository',
'Modules\User\Repositories\Sentinel\SentinelAuthenticationRepository'
'Modules\Core\Contracts\Authentication',
'Modules\User\Repositories\Sentinel\SentinelAuthentication'
);
}
......
<?php namespace Modules\User\Repositories;
interface AuthenticationRepository
{
/**
* Authenticate a user
* @param array $credentials
* @param bool $remember Remember the user
* @return mixed
*/
public function login(array $credentials, $remember = false);
/**
* Register a new user.
* @param array $user
* @return bool
*/
public function register(array $user);
/**
* Activate the given used id
* @param int $userId
* @param string $code
* @return mixed
*/
public function activate($userId, $code);
/**
* Assign a role to the given user.
* @param \Modules\User\Repositories\UserRepository $user
* @param \Modules\User\Repositories\RoleRepository $role
* @return mixed
*/
public function assignRole($user, $role);
/**
* Log the user out of the application.
* @return mixed
*/
public function logout();
/**
* Create an activation code for the given user
* @param $user
* @return mixed
*/
public function createActivation($user);
/**
* Create a reminders code for the given user
* @param $user
* @return mixed
*/
public function createReminderCode($user);
/**
* Completes the reset password process
* @param $user
* @param string $code
* @param string $password
* @return bool
*/
public function completeResetPassword($user, $code, $password);
}
......@@ -5,9 +5,9 @@ use Cartalyst\Sentinel\Checkpoints\ThrottlingException;
use Cartalyst\Sentinel\Laravel\Facades\Activation;
use Cartalyst\Sentinel\Laravel\Facades\Reminder;
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
use Modules\User\Repositories\AuthenticationRepository;
use Modules\Core\Contracts\Authentication;
class SentinelAuthenticationRepository implements AuthenticationRepository
class SentinelAuthentication implements Authentication
{
/**
* Authenticate a user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment