• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Middleware\VerifyCsrfToken类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Illuminate\Foundation\Http\Middleware\VerifyCsrfToken的典型用法代码示例。如果您正苦于以下问题:PHP VerifyCsrfToken类的具体用法?PHP VerifyCsrfToken怎么用?PHP VerifyCsrfToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了VerifyCsrfToken类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: handle

 public function handle($request, \Closure $next)
 {
     try {
         return parent::handle($request, $next);
     } catch (TokenMismatchException $e) {
         return $this->unauthorizedResponse();
     }
 }
开发者ID:deadem,项目名称:djem,代码行数:8,代码来源:VerifyCsrfToken.php


示例2: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!\Request::is('ws/*') && !\Request::ajax()) {
         return parent::handle($request, $next);
     }
     return $this->addCookieToResponse($request, $next($request));
 }
开发者ID:bilel99,项目名称:tetris_webservice,代码行数:14,代码来源:VerifyCsrfToken.php


示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ('testing' !== app()->environment()) {
         return parent::handle($request, $next);
     }
     return $next($request);
 }
开发者ID:berkapavel,项目名称:Laravel5-Time-Tracker-Project-manager,代码行数:14,代码来源:VerifyCsrfToken.php


示例4: handle

 /**
  * {@inheritDoc}
  */
 public function handle($request, Closure $next)
 {
     if (is_api_request()) {
         return $this->addCookieToResponse($request, $next($request));
     }
     return parent::handle($request, $next);
 }
开发者ID:hongpyo,项目名称:l5essential,代码行数:10,代码来源:VerifyCsrfToken.php


示例5: tokensMatch

 protected function tokensMatch($request)
 {
     if ($request->wantsJson()) {
         return true;
     }
     return parent::tokensMatch($request);
 }
开发者ID:Rhincodon,项目名称:test-laravel,代码行数:7,代码来源:VerifyCsrfToken.php


示例6: handle

 public function handle($request, Closure $next)
 {
     if (!$request->is("api/*")) {
         return parent::handle($request, $next);
     }
     return $next($request);
 }
开发者ID:Insantani,项目名称:SourceTree-diovi,代码行数:7,代码来源:VerifyCsrfToken.php


示例7: addCookieToResponse

 /**
  * Add the CSRF token to the response cookies.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Illuminate\Http\Response  $response
  * @return \Illuminate\Http\Response
  */
 protected function addCookieToResponse($request, $response)
 {
     if ('array' !== config('session.driver')) {
         return parent::addCookieToResponse($request, $response);
     }
     return $response;
 }
开发者ID:BePsvPT,项目名称:CCU,代码行数:14,代码来源:VerifyCsrfToken.php


示例8: shouldPassThrough

 protected function shouldPassThrough($request)
 {
     if ($request->is('login') && $request->ajax()) {
         return true;
     }
     return parent::shouldPassThrough($request);
 }
开发者ID:MetropoliaUAS,项目名称:ISDProject-Online,代码行数:7,代码来源:VerifyCsrfToken.php


示例9: handle

 /**
  * {@inheritDoc}
  */
 public function handle($request, Closure $next)
 {
     if (is_api_request()) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:linuxssm,项目名称:l5essential,代码行数:10,代码来源:VerifyCsrfToken.php


示例10: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->shouldIgnore($request)) {
         return $this->addCookieToResponse($request, $next($request));
     }
     return parent::handle($request, $next);
 }
开发者ID:devisephp,项目名称:cms,代码行数:14,代码来源:VerifyCsrfToken.php


示例11: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->getRequestUri() == '/en/update/docs') {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:Houbsi,项目名称:Website,代码行数:14,代码来源:VerifyCsrfToken.php


示例12: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->method() == 'POST') {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:lanhongjie,项目名称:todoApp,代码行数:14,代码来源:VerifyCsrfToken.php


示例13: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (\App::environment() == 'testing') {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:hlmasterchief,项目名称:plock,代码行数:14,代码来源:VerifyCsrfToken.php


示例14: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $userKey = $request->input('_key');
     if ($userKey && !empty($userKey)) {
         $user = User::where('user_key', $userKey)->first();
         if (Auth::check()) {
             $prevuser = Auth::user();
             Auth::logout();
         }
         if ($user->exists()) {
             Auth::login($user);
             $response = $next($request);
             Auth::logout();
             if (isset($prevuser) && isset($prevuser->id)) {
                 Auth::login($prevuser);
             }
             return $response;
         } else {
             $response = $next($request);
         }
         if (isset($prevuser)) {
             Auth::login($prevuser);
         }
         return $response;
     }
     if ($request->is('api/v1/donate/ipn')) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:RobinJ1995,项目名称:VacStatus,代码行数:37,代码来源:VerifyCsrfToken.php


示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (strpos($request, 'infusion')) {
         return $this->addCookieToResponse($request, $next($request));
     }
     return parent::handle($request, $next);
 }
开发者ID:keiwerkgvr,项目名称:salesperformanceindicator,代码行数:14,代码来源:VerifyCsrfToken.php


示例16: handle

 public function handle($request, Closure $next)
 {
     if ($request->ajax()) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:rosemalejohn,项目名称:dnsc-hris,代码行数:7,代码来源:VerifyCsrfToken.php


示例17: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (strpos($request->getRequestUri(), 'queue') >= 0) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:janusnic,项目名称:imgubox,代码行数:14,代码来源:VerifyCsrfToken.php


示例18: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->is('admin/upload')) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:x303597316,项目名称:inspirer,代码行数:15,代码来源:VerifyCsrfToken.php


示例19: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request instanceof Request) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:jenky,项目名称:muzik,代码行数:15,代码来源:VerifyCsrfToken.php


示例20: handle

 public function handle($request, Closure $next)
 {
     if (in_array($request->path(), $this->openRoutes)) {
         return $next($request);
     } else {
         return parent::handle($request, $next);
     }
 }
开发者ID:Gladdy,项目名称:clipshare-old,代码行数:8,代码来源:VerifyCsrfToken.php



注:本文中的Illuminate\Foundation\Http\Middleware\VerifyCsrfToken类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Providers\AuthServiceProvider类代码示例发布时间:2022-05-23
下一篇:
PHP Exceptions\Handler类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap