Example #1
0
        public async Task <string> Register(Guid token)
        {
            MessengerLink link = await _botRepository.GetLinkByAuthToken(token);

            if (link.UserId.HasValue)
            {
                return("You are already registered!");
            }
            string   domainName = User.Identity.Name;
            UserInfo ttUser     = _usersApp.GetUserInfo(domainName);

            if (ttUser != null)
            {
                await _botRepository.RegisterUser(ttUser.Id, ttUser.Email, token);

                return("Successfully registered!");
            }
            return($"No user with domain name '{domainName}' in TimeTracker");
        }