Exemple #1
0
        public static UserStateInfo Login(AuthParameterInfo loginInfo)
        {
            AuthParameter parameter = loginInfo.MappingTo <AuthParameter>();
            UserState     state     = User.CreateState(parameter);

            if (state == null)
            {
                return(null);
            }
            return(state.MappingTo <UserStateInfo>());
        }
Exemple #2
0
        public ServiceResult <UserStateInfo> Login(AuthParameterInfo parameter)
        {
            parameter.AppIp    = Context.Request.UserHostAddress;
            parameter.DeviceId = parameter.DeviceId ?? parameter.Ip;
            UserStateInfo state = UserAdapter.Login(parameter);

            if (state != null)
            {
                return(new ServiceResult <UserStateInfo>(state));
            }
            else
            {
                return(new ServiceResult <UserStateInfo>(ServiceState.InvalidUserCredentials));
            }
        }