草庐IT

play-services-auth

全部标签

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 - Symfony 2.5 "You have requested a non-existent service "siteTest.b"

当运行workspace/app_dev.php时,没问题。但是当我尝试运行workspace/app.php时,我得到:"Youhaverequestedanon-existentservice"siteTest.b"我不知道我做错了什么。应用程序/配置/config.yml:imports:-{resource:parameters.yml}-{resource:security.yml}framework:secret:"%secret%"router:resource:"%kernel.root_dir%/config/routing.yml"strict_requiremen

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 - Symfony2 : "Fatal error: Class service..." while trying to include a class as an service in config. yml (TCPPDF)

我正在尝试在Symfony2(2.1.4-DEV)中使用服务容器包含类TCPDF的扩展。为此,我编辑了symfony/app/config/config.yml:services:extend_pdf:class:Acme\VSBundle\extend_pdf在文件symfony/src/Acme/VSBundle/extend_pdf.php中,我有一个像这样的虚拟类:我将其加载到Controller中,例如:functiontestAction(){$extendpdf=$this->get('extend_pdf');returnnewResponse('success');}

amazon-web-services - 带有 Nginx 和 PHP-FPM 的 AWS EC2 - 不能将 CPU 推到 50% 以上

我正在尝试测试AWSAutoScaling,为此我需要将一个EC2实例推送到触发器(比如CPU使用率超过80%几分钟)会导致另一个实例启动的点。我发现的问题是无法使CPU使用率超过50%。我使用的是Nginx,我已将worker_connections的数量从1024调整到更大的数量。我将worker_processes设置为自动。另外fastcgi_params设置如下:fastcgi_connect_timeout60;fastcgi_send_timeout180;fastcgi_read_timeout180;fastcgi_buffer_size128k;fastcgi_bu

php - 拉维尔 : Overriding a Bundle's Service Providers

我有一个项目使用Laravel的Sentinel包。前一段时间,我问了一个关于extendingamodelprovidedinthebundle的问题.我接受的答案有效,但它需要在供应商文件夹中编辑bundle的代码。从那时起,我运行了一个composerupdate命令,我应用的更改被覆盖了(这并不奇怪)。我现在对laravel的工作原理有了更多的了解,所以我能够追溯到我的应用程序引用bundle服务的终点。在我的config/app.php文件中,我有服务提供商引用:'Sentinel\SentinelServiceProvider',SentinelServiceProvide