Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 99c7172f
authored
Aug 15, 2019
by
Jonathan Reinink
Committed by
GitHub
Aug 15, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39 from Juhlinus/auth-redirect
Added guest middleware and changed redirect path
2 parents
14352710
788445e2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
app/Http/Middleware/RedirectIfAuthenticated.php
routes/web.php
app/Http/Middleware/RedirectIfAuthenticated.php
View file @
99c7172
...
@@ -18,7 +18,7 @@ class RedirectIfAuthenticated
...
@@ -18,7 +18,7 @@ class RedirectIfAuthenticated
public
function
handle
(
$request
,
Closure
$next
,
$guard
=
null
)
public
function
handle
(
$request
,
Closure
$next
,
$guard
=
null
)
{
{
if
(
Auth
::
guard
(
$guard
)
->
check
())
{
if
(
Auth
::
guard
(
$guard
)
->
check
())
{
return
redirect
(
'/
home
'
);
return
redirect
(
'/'
);
}
}
return
$next
(
$request
);
return
$next
(
$request
);
...
...
routes/web.php
View file @
99c7172
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
*/
*/
// Auth
// Auth
Route
::
get
(
'login'
)
->
name
(
'login'
)
->
uses
(
'Auth\LoginController@showLoginForm'
);
Route
::
get
(
'login'
)
->
name
(
'login'
)
->
uses
(
'Auth\LoginController@showLoginForm'
)
->
middleware
(
'guest'
)
;
Route
::
post
(
'login'
)
->
name
(
'login.attempt'
)
->
uses
(
'Auth\LoginController@login'
);
Route
::
post
(
'login'
)
->
name
(
'login.attempt'
)
->
uses
(
'Auth\LoginController@login'
)
->
middleware
(
'guest'
)
;
Route
::
post
(
'logout'
)
->
name
(
'logout'
)
->
uses
(
'Auth\LoginController@logout'
);
Route
::
post
(
'logout'
)
->
name
(
'logout'
)
->
uses
(
'Auth\LoginController@logout'
);
// Dashboard
// Dashboard
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment