Ejemplo n.º 1
0
        /// <summary>
        /// 接收RefreshToken
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public async Task ReceiveAsync(AuthenticationTokenReceiveContext context)
        {
            AuthenticationTicket ticket;

            if (_refreshTokens.TryRemove(context.Token, out ticket))
            {
                var query = _aspnetUsersService.QueryUsersByPhoneNumber(ticket.Identity.Name);
                if (query.PhoneNumberConfirmed)
                {
                    context.SetTicket(ticket);
                }
                else
                {
                    return;
                }
            }
        }