/// <summary>
        /// Get the currently logged in user
        /// </summary>
        private User GetLoggedInUser(INancyModule nancyModule)
        {
            var currentUser = nancyModule.GetPrincipal();
            if (!currentUser.IsAuthenticated())
                return null;

            if (string.IsNullOrWhiteSpace(currentUser.Email))
                return null;

            User loggedInUser = null;//ReadStore.Users.Get(currentUser.Email).FirstOrDefault();
            return loggedInUser;
        }
Example #2
0
        /// <summary>
        /// Get the currently logged in user
        /// </summary>
        private User GetLoggedInUser(INancyModule nancyModule)
        {
            var currentUser = nancyModule.GetPrincipal();

            if (!currentUser.IsAuthenticated())
            {
                return(null);
            }

            if (string.IsNullOrWhiteSpace(currentUser.Email))
            {
                return(null);
            }

            User loggedInUser = null;//ReadStore.Users.Get(currentUser.Email).FirstOrDefault();

            return(loggedInUser);
        }
Example #3
0
 public static bool IsAuthenticated(this INancyModule module)
 {
     return(module.GetPrincipal().IsAuthenticated());
 }