mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
This commit is contained in:
parent
23db2e9e4e
commit
f86b6c49fb
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Visiosoft\ProfileModule\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\Auth\Guard;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class authCheck
|
||||||
|
{
|
||||||
|
|
||||||
|
private $auth;
|
||||||
|
private $request;
|
||||||
|
|
||||||
|
public function __construct(Guard $auth,Request $request)
|
||||||
|
{
|
||||||
|
$this->auth = $auth;
|
||||||
|
$this->request = $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Guard $auth
|
||||||
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
if ($this->auth->check()) {
|
||||||
|
return redirect($this->request->get('redirect', '/'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,7 @@ use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
|
|||||||
use Visiosoft\ProfileModule\Adress\AdressRepository;
|
use Visiosoft\ProfileModule\Adress\AdressRepository;
|
||||||
use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
|
use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
|
||||||
use Visiosoft\ProfileModule\Adress\AdressModel;
|
use Visiosoft\ProfileModule\Adress\AdressModel;
|
||||||
|
use Visiosoft\ProfileModule\Http\Middleware\authCheck;
|
||||||
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
|
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
|
||||||
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
|
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
|
||||||
use Visiosoft\ProfileModule\Profile\Profile\ProfileFormBuilder;
|
use Visiosoft\ProfileModule\Profile\Profile\ProfileFormBuilder;
|
||||||
@ -105,6 +106,15 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
|
|||||||
],
|
],
|
||||||
'ajax/phone-validation' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@phoneValidation',
|
'ajax/phone-validation' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@phoneValidation',
|
||||||
|
|
||||||
|
'register' => [
|
||||||
|
'middleware' => [
|
||||||
|
authCheck::class
|
||||||
|
],
|
||||||
|
'ttl' => 0,
|
||||||
|
'as' => 'anomaly.module.users::register',
|
||||||
|
'uses' => 'Anomaly\UsersModule\Http\Controller\RegisterController@register',
|
||||||
|
],
|
||||||
|
|
||||||
/* Login */
|
/* Login */
|
||||||
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',
|
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user