Skip to content

Commit eadb70d

Browse files
fix(routes): adjust middleware for registration route and enhance session check in ImpersonateMiddleware
1 parent 2f74640 commit eadb70d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
->name('verification.send');
2929

3030
Route::prefix('register')->as('register.')
31-
->withoutMiddleware(['modularity.panel', 'web.auth', 'modularity.core'])
3231
->middleware(['web', 'modularity.core'])
32+
->withoutMiddleware(['modularity.panel', 'web.auth'])
3333
->group(function () {
3434

3535
Route::get('/password/generate/{token}', 'PasswordController@showForm')

src/Http/Middleware/ImpersonateMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(AuthFactory $authFactory)
2626
*/
2727
public function handle($request, Closure $next)
2828
{
29-
if ($request->session()->has('impersonate')) {
29+
if ($request->hasSession() && $request->session()->has('impersonate')) {
3030
$this->authFactory->guard(Modularity::getAuthGuardName())->onceUsingId($request->session()->get('impersonate'));
3131
}
3232

0 commit comments

Comments
 (0)