예제 #1
0
 public UserSessionInfo QuerySession(string sessionId)
 {
     using(LoginService service = new LoginService())
     {
         var sessionInfo = service.Query(sessionId);
         if (sessionInfo == null)
         {
             throw new SessionDoesNotExistException();
         }
         return new UserSessionInfo(sessionInfo.User, sessionInfo.Credentials.SessionToken);
     }
 }
예제 #2
0
파일: SessionInfo.cs 프로젝트: nhannd/Xian
        public void Validate()
        {
            _valid = false;

            using(var service = new LoginService())
            {
                SessionInfo sessionInfo = service.Query(Credentials.SessionToken.Id);

                if (sessionInfo == null)
                {
                    throw new SessionValidationException();
                }

                _user.Credentials = sessionInfo.Credentials;
                SessionToken newToken = service.Renew(Credentials.SessionToken.Id);
                _user.Credentials.SessionToken = newToken;
                _valid = true;
            }   
        }
예제 #3
0
        public void Validate()
        {
            _valid = false;

            using (var service = new LoginService())
            {
                SessionInfo sessionInfo = service.Query(Credentials.SessionToken.Id);

                if (sessionInfo == null)
                {
                    throw new SessionValidationException();
                }

                _user.Credentials = sessionInfo.Credentials;
                SessionToken newToken = service.Renew(Credentials.SessionToken.Id);
                _user.Credentials.SessionToken = newToken;
                _valid = true;
            }
        }
예제 #4
0
        public void Query()
        {
            _valid = false;

            using (var service = new LoginService())
            {
                SessionInfo sessionInfo = service.Query(Credentials.SessionToken.Id);

                if (sessionInfo == null)
                {
                    throw new SessionValidationException();
                }

                if (sessionInfo.Credentials.SessionToken.ExpiryTime < Platform.Time)
                {
                    throw new SessionValidationException();
                }

                _user.Credentials = sessionInfo.Credentials;
                _valid            = true;
            }
        }
예제 #5
0
파일: SessionInfo.cs 프로젝트: nhannd/Xian
        public void Query()
        {
            _valid = false;

            using (var service = new LoginService())
            {
                SessionInfo sessionInfo = service.Query(Credentials.SessionToken.Id);

                if (sessionInfo == null)
                {
                    throw new SessionValidationException();
                }

                if (sessionInfo.Credentials.SessionToken.ExpiryTime < Platform.Time)
                {
                    throw new SessionValidationException();
                }

                _user.Credentials = sessionInfo.Credentials;                
                _valid = true;
            }
        }