Exemplo n.º 1
0
        public void SuccessfulUser(string username, FubuContinuation redirection = null)
        {
            _result.Success      = true;
            _result.Continuation = redirection ?? FubuContinuation.NextBehavior();

            var principal = _principalBuilder.Build(username);

            _context.Current = principal;
            _session.MarkAuthenticated(username);
        }
        public AuthResult TryToApply()
        {
            string userName = _session.PreviouslyAuthenticatedUser();

            if (userName.IsNotEmpty())
            {
                _session.MarkAccessed();
                var principal = _builder.Build(userName);
                _context.Current = principal;

                return(new AuthResult {
                    Success = true
                });
            }

            return(new AuthResult {
                Success = false
            });;
        }