<?php

namespace Buckhill\LaravelSAML\Providers;

use Illuminate\Support\ServiceProvider;
use Buckhill\LaravelSAML\Services\AuthenticatedUser;

class AuthenticatedUserProvider extends ServiceProvider
{
    public function register()
    {
        $this->app->singleton('AuthenticatedUser', function($app)
        {
            return AuthenticatedUser::fromSession(session(config('sso.SP.sessionKeyName')));
        });
    }
}