Exemplo n.º 1
0
        public async Task <IActionResult> OnPostRemoveLinkAsync(string provider)
        {
            var userId = _currentUserService.UserId;
            var result = await _externalLoginService.RemoveLoginAsync(userId, provider);

            if (result.Succeeded)
            {
                StatusMessage = $"The {provider} account was successfully unlinked";
                _logger.LogInformation("User with ID '{UserId}' unlinked {ProviderName} account.", userId, provider);
                return(RedirectToPage());
            }
            else
            {
                StatusMessage = $"An error occured while unlinking the account";
                return(Page());
            }
        }