forked from statamic/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Independent Auth Guard for Statamic (statamic#3143)
- Loading branch information
1 parent
4b23fde
commit 3dddbd9
Showing
12 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Statamic\Http\Controllers\CP\Auth; | ||
|
||
use Illuminate\Support\Facades\Password; | ||
use Statamic\Auth\Passwords\PasswordReset; | ||
use Statamic\Http\Controllers\ResetPasswordController as Controller; | ||
use Statamic\Http\Middleware\CP\RedirectIfAuthorized; | ||
|
||
class ResetPasswordController extends Controller | ||
{ | ||
public function __construct() | ||
{ | ||
$this->middleware(RedirectIfAuthorized::class); | ||
} | ||
|
||
public function broker() | ||
{ | ||
$broker = config('statamic.users.passwords.'.PasswordReset::BROKER_RESETS); | ||
|
||
if (is_array($broker)) { | ||
$broker = $broker['cp']; | ||
} | ||
|
||
return Password::broker($broker); | ||
} | ||
|
||
protected function resetFormAction() | ||
{ | ||
return route('statamic.cp.password.reset.action'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Statamic\Http\Middleware; | ||
|
||
use Closure; | ||
use Illuminate\Support\Facades\Auth; | ||
|
||
class AuthGuard | ||
{ | ||
public function handle($request, Closure $next) | ||
{ | ||
Auth::shouldUse(config('statamic.users.guards.web', 'web')); | ||
|
||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Statamic\Http\Middleware\CP; | ||
|
||
use Closure; | ||
use Illuminate\Support\Facades\Auth; | ||
|
||
class AuthGuard | ||
{ | ||
public function handle($request, Closure $next) | ||
{ | ||
Auth::shouldUse(config('statamic.users.guards.cp', 'web')); | ||
|
||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters