using System.Web.Mvc;
using AutoMapper;
using Qusion.Cms.Users.Core;
using Qusion.Cms.Users.Domain;
using Qusion.WebApp.Areas.Qusion.Models.Users;
using Qusion.Framework.Configuration;

namespace Qusion.WebApp.Areas.Qusion.Controllers
{
    //[QusionAuthorize(LoginPage = "/qusion/account/login")]
    [Authorize]
    public class HomeController : Controller
    {
        private readonly UserService _userService;

        public HomeController(UserService userService)
        {
            _userService = userService;
        }


        //
        // GET: /Qusion/Home/

        public ActionResult Index()
        {
            var user = _userService.Get(User.Identity.Name);
            var model = Mapper.Map<User, UserModel>(user);
            return View(model);
        }

    }
}