¨4.0.1¨
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Modules\User\Http\Controllers;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Page\Entities\Page;
|
||||
use Modules\User\Entities\User;
|
||||
use Modules\User\LoginProvider;
|
||||
@@ -11,30 +12,10 @@ use Laravel\Socialite\Facades\Socialite;
|
||||
|
||||
class AuthController extends BaseAuthController
|
||||
{
|
||||
/**
|
||||
* Where to redirect users after login..
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function redirectTo()
|
||||
{
|
||||
return route('account.dashboard.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* The login URL.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function loginUrl()
|
||||
{
|
||||
return route('login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show login form.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return Response
|
||||
*/
|
||||
public function getLogin()
|
||||
{
|
||||
@@ -43,30 +24,34 @@ class AuthController extends BaseAuthController
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Redirect the user to the given provider authentication page.
|
||||
*
|
||||
* @param string $provider
|
||||
* @return \Illuminate\Http\Response
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function redirectToProvider($provider)
|
||||
{
|
||||
if (! LoginProvider::isEnable($provider)) {
|
||||
if (!LoginProvider::isEnable($provider)) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
return Socialite::driver($provider)->redirect();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Obtain the user information from the given provider.
|
||||
*
|
||||
* @param string $provider
|
||||
* @return \Illuminate\Http\Response
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function handleProviderCallback($provider)
|
||||
{
|
||||
if (! LoginProvider::isEnable($provider)) {
|
||||
if (!LoginProvider::isEnable($provider)) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
@@ -101,15 +86,11 @@ class AuthController extends BaseAuthController
|
||||
return redirect($this->redirectTo());
|
||||
}
|
||||
|
||||
private function extractName($name)
|
||||
{
|
||||
return explode(' ', $name, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show registrations form.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
* @return Response
|
||||
*/
|
||||
public function getRegister()
|
||||
{
|
||||
@@ -119,6 +100,71 @@ class AuthController extends BaseAuthController
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show reset password form.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getReset()
|
||||
{
|
||||
return view('public.auth.reset.begin');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function redirectTo()
|
||||
{
|
||||
return route('account.dashboard.index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The login URL.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function loginUrl()
|
||||
{
|
||||
return route('login');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reset complete form route.
|
||||
*
|
||||
* @param User $user
|
||||
* @param string $code
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function resetCompleteRoute($user, $code)
|
||||
{
|
||||
return route('reset.complete', [$user->email, $code]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Password reset complete view.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function resetCompleteView()
|
||||
{
|
||||
return view('public.auth.reset.complete');
|
||||
}
|
||||
|
||||
|
||||
private function extractName($name)
|
||||
{
|
||||
return explode(' ', $name, 2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get privacy page url.
|
||||
*
|
||||
@@ -130,36 +176,4 @@ class AuthController extends BaseAuthController
|
||||
return Page::urlForPage(setting('storefront_privacy_page'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Show reset password form.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function getReset()
|
||||
{
|
||||
return view('public.auth.reset.begin');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset complete form route.
|
||||
*
|
||||
* @param \Modules\User\Entities\User $user
|
||||
* @param string $code
|
||||
* @return string
|
||||
*/
|
||||
protected function resetCompleteRoute($user, $code)
|
||||
{
|
||||
return route('reset.complete', [$user->email, $code]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Password reset complete view.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function resetCompleteView()
|
||||
{
|
||||
return view('public.auth.reset.complete');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user