简体   繁体   English

Laravel 5.2 /登录和/注册不起作用

[英]Laravel 5.2 /login & /register not working

I'm testing out the new Laravel and when creating a basic application 我正在测试新的Laravel,并在创建基本应用程序时

composer create-project laravel/laravel
composer install
composer update
php artisan make:auth

I'm presented with the basic authentication scaffold, after doing a little playing around, the links on the menu for logging in and registers stop working. 向我介绍了基本的身份验证支架,在进行了一些操作之后,登录和注册菜单上的链接停止工作。 I coudn't find the problem to fix it so I just created a new project. 我找不到解决该问题的方法,所以我刚刚创建了一个新项目。

And the same has happened again. 同样又发生了。

All i've done is 我所做的就是

  1. Created a new view members.dashboard 创建了一个新的视图members.dashboard
  2. Set the login redirect to go to the dash board after logging in 设置登录重定向以在登录后转到仪表板

Has anyone seen this problem before and can point me to the error? 有没有人以前见过这个问题,可以指出我的错误?

UPDATE UPDATE

/auth/login = no route
/auth/register = no route
/login = redirect to home page
/register = redirect to home page

You were logged in & cookies were keeping track of your authentication status. 您已登录,Cookie会跟踪您的身份验证状态。 Thus you are redirected to home page when you visit 因此,当您访问时,您将被重定向到home page

/login
/register

In Laravel Auth, Logged-In users can't view login page or register page. 在Laravel Auth中,登录用户无法查看login页面或register页面。 You have to either logout OR delete the cookies (not a recommended way) to view these pages again. 您必须注销或删除cookie(不建议这样做)才能再次查看这些页面。

If you are making mention to the 'Login' and 'Register' links the layout supplies, they work fine. 如果要提及“登录”和“注册”链接的版面供应,它们可以正常工作。

By default the '/' route doesn't have the 'web' middleware group applied, so no sessions/auth. 默认情况下,“ /”路由未应用“网络”中间件组,因此没有会​​话/身份验证。 Auth will think you are not logged in if you don't have that middleware group applied to any routes where you need to use Auth. 如果您没有将该中间件组应用于需要使用Auth的任何路由,则Auth会认为您尚未登录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM