{"action":"closed","issue":{"url":"https://api.github.com/repos/FrozenNode/Laravel-Administrator/issues/914","labels_url":"https://api.github.com/repos/FrozenNode/Laravel-Administrator/issues/914/labels{/name}","comments_url":"https://api.github.com/repos/FrozenNode/Laravel-Administrator/issues/914/comments","events_url":"https://api.github.com/repos/FrozenNode/Laravel-Administrator/issues/914/events","html_url":"https://github.com/FrozenNode/Laravel-Administrator/issues/914","id":102440677,"number":914,"title":"Underfined variable: redirectKey","user":{"login":"magamlag","id":673055,"avatar_url":"https://avatars.githubusercontent.com/u/673055?v=3","gravatar_id":"","url":"https://api.github.com/users/magamlag","html_url":"https://github.com/magamlag","followers_url":"https://api.github.com/users/magamlag/followers","following_url":"https://api.github.com/users/magamlag/following{/other_user}","gists_url":"https://api.github.com/users/magamlag/gists{/gist_id}","starred_url":"https://api.github.com/users/magamlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magamlag/subscriptions","organizations_url":"https://api.github.com/users/magamlag/orgs","repos_url":"https://api.github.com/users/magamlag/repos","events_url":"https://api.github.com/users/magamlag/events{/privacy}","received_events_url":"https://api.github.com/users/magamlag/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-21T18:42:48Z","updated_at":"2015-09-26T03:44:12Z","closed_at":"2015-09-26T03:44:12Z","body":"I'm getting exception if add Redirect with custom error message to Closure of permissions:\r\n```\r\n'permission'=> function()\r\n\t{\r\n        $user = Auth::user();\r\n        if($user->hasRole('admin'))\r\n            return true;\r\n        elseif($user)\r\n            return Redirect::to('home/dashboard')->withError('You do not have permission to access this resource');\r\n        else\r\n            return Redirect::guest('home/login');\r\n    },\r\n```\r\nReason of this exception:\r\n```\r\n$redirectKey = Config::get('administrator::administrator.login_redirect_key', 'redirect');\r\n    $redirectUri = Request::url();\r\n```\r\nIn file filter.php this part of code(line: 18,19) need to move before if statement\r\nIn case if use package - FrozenNode for Laravel 4"}}