Ejemplo n.º 1
0
        public FubuContinuation Execute(LogOnRequestModel model)
        {
            if (!String.IsNullOrWhiteSpace(model.Name) && !String.IsNullOrWhiteSpace(model.Password))
            {
                formsAuthenticationWrapper.SetAuthCookie(model.Name.Trim(), false);

                // TODO: We should be able to redirect based on ViewModel-In, but
                // FubuContinuation assetions don't like. Must investigate!
                return FubuContinuation.RedirectTo<Home.GetHandler>(x => x.Execute());
            }

            return FubuContinuation.RedirectTo<LogOn.GetHandler>(x => x.Execute());
        }
Ejemplo n.º 2
0
        public FubuContinuation Execute(LogOnRequestModel model)
        {
            if (!String.IsNullOrWhiteSpace(model.Name) && !String.IsNullOrWhiteSpace(model.Password))
            {
                var username= model.Name.Trim();

                authContext.ThisUserHasBeenAuthenticated(username, false);

                if (userData.AllowedGroups.ContainsKey(username))
                {
                    Roles.AddUserToRoles(username, userData.AllowedGroups[username].ToArray());
                }

                // TODO: We should be able to redirect based on ViewModel-In, but
                // FubuContinuation assetions don't like. Must investigate!
                return FubuContinuation.RedirectTo<Home.GetHandler>(x => x.Execute());
            }

            return FubuContinuation.RedirectTo<LogOn.GetHandler>(x => x.Execute());
        }