Browse Source

Use constant for CSRF token.

Taylor Otwell 13 years ago
parent
commit
a739afc32f
1 changed files with 6 additions and 8 deletions
  1. 6 8
      laravel/request.php

+ 6 - 8
laravel/request.php

@@ -1,4 +1,7 @@
-<?php namespace Laravel; use Closure;
+<?php namespace Laravel;
+
+use Closure;
+use Laravel\Session\Payload as Session;
 
 class Request {
 
@@ -121,12 +124,7 @@ class Request {
 	 */
 	public static function forged()
 	{
-		if (Config::$items['session']['driver'] == '')
-		{
-			throw new \LogicException("A session driver must be specified to use the CSRF filter.");
-		}
-
-		return Input::get('csrf_token') !== IoC::core('session')->token();
+		return Input::get(Session::token) !== IoC::core('session')->token();
 	}
 
 	/**
@@ -151,4 +149,4 @@ class Request {
 		return static::$route;
 	}
 
-}
+}