Skip to content

Commit

Permalink
Switch Auth to traditional facade
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Mar 31, 2014
1 parent 51ef54e commit 5b934de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Plugin.php
@@ -1,8 +1,9 @@
<?php namespace RainLab\User;

use App;
use Backend;
use System\Classes\PluginBase;
use October\Rain\Support\FacadeLoader;
use Illuminate\Foundation\AliasLoader;

class Plugin extends PluginBase
{
Expand All @@ -19,8 +20,12 @@ public function pluginDetails()

public function register()
{
$facade = FacadeLoader::instance();
$facade->facade('Auth', 'RainLab\User\Facades\Auth');
$alias = AliasLoader::getInstance();
$alias->alias('Auth', 'RainLab\User\Facades\Auth');

App::singleton('user.auth', function() {
return \RainLab\User\Classes\AuthManager::instance();
});
}

public function registerComponents()
Expand Down
4 changes: 2 additions & 2 deletions facades/Auth.php
Expand Up @@ -5,8 +5,8 @@
class Auth extends Facade
{
/**
* Get the class name this facade is acting on behalf of.
* Get the registered name of the component.
* @return string
*/
protected static function getFacadeAccessor() { return 'RainLab\User\Classes\AuthManager'; }
protected static function getFacadeAccessor() { return 'user.auth'; }
}

0 comments on commit 5b934de

Please sign in to comment.