示例#1
0
        public async Task <IActionResult> SendCrossLogin(string address, string type)
        {
            if (String.IsNullOrEmpty(address))
            {
                return(Redirect("/"));
            }
            await _crossConnectionManager.SetupContact(address);

            RemoteAuthToken token = new RemoteAuthToken()
            {
                Token      = Guid.NewGuid().ToString(),
                UserID     = Tools.GetUserID(User),
                ValidUntil = DateTime.Now.AddMonths(1)
            };
            await _repository.AddRemoteAuthTokenAsync(token);

            await _repository.SaveChangesAsync();

            return(Redirect($"{address}/Login/Callback?token={token.Token}&address={_config.InstanceURL}&type={type}"));
        }