草庐IT

ion_auth

全部标签

php - Laravel Auth::attempt 每次都失败

我在我的laravel应用程序上创建了一个测试用户。详情是用户:joe@gmail.com密码:123456当我完成注册过程时,一切都按预期进行,并且在数据库的用户表中创建了一个条目完成后,我将用户重定向到仪表板。publicfunctionpostCreate(){//Rules$rules=array('fname'=>'required|alpha|min:2','lname'=>'required|alpha|min:2','email'=>'required|email|unique:users','password'=>'required|alpha_num|between

php - 我可以将 Ion auth 设置为通过用户名或电子邮件登录吗

我知道我可以在配置中将ionauth设置为通过用户名登录,我也知道我可以在配置中将它设置为通过电子邮件登录。有没有一种简单的方法可以将其设置为自动使用? 最佳答案 如果是自动的,你的意思是先尝试一个,然后再尝试另一个,看看其中一个是否给出有效的返回:登录发生在ion_auth_model行:899->where($this->identity_column,$this->db->escape_str($identity))因此您可以将其更改为执行“或”并尝试两列。您需要在整个模型中执行此操作,因为要考虑的不仅仅是实际登录,还有一个用

php - 拉维尔 4 : Two different view pages for a single URI based on auth status

我最近开始使用Laravel4进行开发,我对路由有疑问。对于“/”,我希望根据用户的授权状态有两个不同的View页面。如果用户已登录并正在查看“/”,我想向他们展示一个带有管理控件的View,当用户在未登录的情况下以普通用户的身份查看“/”时,我想提供一个一般信息View。为了实现这一点,我一直在尝试使用过滤器“auth”和“guest”,但没有成功。//应用程序/routes.php//routeforloggedinusersRoute::get('/',array('before'=>'auth',function(){return'loggedin!';}));//fornor

php - 在 Laravel 5.1 中使用中间件时出现 Class jwt-auth does not exist 错误

我按照官方的JWT-Auth安装https://github.com/tymondesigns/jwt-auth/wiki/Installation.现在我的Controller中有一个中间件:$this->middleware('jwt-auth',['only'=>['postChange','postChoose']]);我还在config/app.php的提供程序数组中添加了Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class但是,当我向API发出请求时,我收到此错误消息:ReflectionExceptioninConta

php - 拉维尔 4 : Stock Auth login won't persist across pages

从所有教程中,我应该能够对用户进行身份验证,然后跳转到任何其他页面,并保持登录。然而,这不起作用。自定义编译的PHPLAMP堆栈。应用存储是可写的。与教程的唯一区别是我使用的是电子邮件而不是用户名。http://laravelbook.com/laravel-user-authentication/http://codehappy.daylerees.com/authenticationsession有效,因为我能够将var存储到session并在不同的页面上读出它。models/User.php(股票)useIlluminate\Auth\UserInterface;useIllum

php - Laravel 5.2 -> 5.3 Auth::user() 返回 null

我已经从5.2升级到5.3,Auth::user()返回null。路线Route::group(['middleware'=>['auth']],function(){Route::get('/test','MyController@showMain');}Controller构造函数调用Auth::check()返回nullpublic$user;publicfunction__construct(){$this->user=Auth::user();}publicfunctionshowMain(){return$this->user;}ControllershowMain调用Au

php - laravel 护照 : Request user() returning null outside auth:api middleware, 和内部返回用户对象

当我尝试使用auth:api中间件获取登录用户的详细信息时,它会在我的Controller函数中返回包含详细信息的用户对象。api.php(withauth:apimiddlewarereturnsUserobject)Route::group(['middleware'=>'auth:api'],function(){Route::get('users/mentor_details/{uuid}','UserController@getMentorProfileDetails');});但是当我试图在这个auth:api中间件之外获取登录用户详细信息时,它返回null。api.php

php - Laravel, Controller 中的 Auth::user()

Laravel框架-为什么我不能在Laravel项目的Controller中使用Auth::user()(查看用户是否已登录)。Session是否未连接到Controller?HomeController.phppublicfunctionisauthorized(){if(Auth::user()){returnView::make('home.basic')->with('basic1','Authorized');}else{returnView::make('home.basic')->with('basic1','NotAuthorized');}}我的登录系统正在运行,登录

php - Auth guard 驱动程序 [api] 未定义

我正在使用laravel5.4并使用jwtauthjwt版本是jwt-auth"tymon/jwt-auth":"0.5.*"在auth.php中我有'guards'=>['web'=>['driver'=>'session','provider'=>'users',],'api'=>['driver'=>'jwt','provider'=>'users',],],在Api.php中我有Route::post('/login','HomeController@authenticate');Route::group(['prefix'=>'v2','middleware'=>'auth:

php - CakePHP ACL 和 Auth 不工作

我有几个关于CakePHP的ACL和Auth系统的问题。acos表中别名的命名约定是什么?是“controllers/Posts/add”还是仅使用“Posts”中的父ID进行“添加”?我的登录无效。当我尝试登录时,我没有收到任何错误消息,但Auth.User和Auth->user('id')都是空的。可能是什么问题呢?我做的一切都像CakePHP的ACL示例中那样。谢谢。更新:我现在可以登录(服务器上的时间设置有问题),我的acos表看起来正确,但我无法执行任何操作。我允许aros_acos表中的操作。如果我使用'$this->Acl->check()'检查权限,如果我给出操作的单个