Skip to content

Commit

Permalink
Allowed setting a custom route in the config file (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
sertxudev authored Oct 7, 2022
1 parent dbfea74 commit 403eef2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config/lockscreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
* If false, you should add the middleware 'lockscreen' manually to the routes.
*/
'append_middleware' => true,

/**
* Route name
* The name of the route to redirect to when the account is locked.
*/
'route' => 'locked',
];
2 changes: 1 addition & 1 deletion src/LockScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function handle(Request $request, Closure $next, string $redirectToRoute
$request->session()->put('auth.locked', true);

return $this->responseFactory->redirectGuest(
$this->urlGenerator->route($redirectToRoute ?? 'locked')
$this->urlGenerator->route($redirectToRoute ?? config('lockscreen.route', 'locked'))
);
}

Expand Down

0 comments on commit 403eef2

Please sign in to comment.