Ejemplo n.º 1
0
        // this is the workaround without key, remove when authentication is released
        public async Task LoginAs(string deprecatedKey, string battleTag)
        {
            var userDetails = await _websiteBackendRepository.GetChatDetails(battleTag);

            var chatUser = new ChatUser(battleTag, userDetails?.ClanId, userDetails?.ProfilePicture);

            await LoginAsAuthenticated(chatUser);
        }
        public async Task <ChatUser> GetUser(string chatKey)
        {
            try
            {
                var user = _authenticationService.GetUserByToken(chatKey);
                if (user == null)
                {
                    return(null);
                }
                var userDetails = await _websiteBackendRepository.GetChatDetails(user.BattleTag);

                return(new ChatUser(user.BattleTag, userDetails?.ClanId, userDetails?.ProfilePicture));
            }
            catch (Exception)
            {
                return(null);
            }
        }