Пример #1
0
        protected override Result <dynamic> ExecuteCore(ObjectContext context)
        {
            var user = this.GetUser(context);

            if (user == null)
            {
                throw new BadRequestException(NotCorrect);
            }

            var token = context.Encrypt(new UserAuth
            {
                UserId   = user.UserNum,
                Username = user.UserName,
                Expired  = context.CreateExpired()
            });

            return(Success(new {
                token
            }));
        }