public async Task <IActionResult> OnGetAsync()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'."));
            }

            //CurrentLogins = await _userManager.GetLoginsAsync(user);
            // Updated line
            CurrentLogins = (await _userManager.GetLoginsEmailInfoAsync(user)).ToList();
            OtherLogins   = (await _signInManager.GetExternalAuthenticationSchemesAsync())
                            // Upated line
                            //.Where(auth => CurrentLogins.All(ul => auth.Name != ul.LoginProvider))
                            .ToList();
            ShowRemoveButton = user.PasswordHash != null || CurrentLogins.Count > 1;
            return(Page());
        }
Пример #2
0
        public async Task <IActionResult> OnGetAsync()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'."));
            }

            Emails = _userManager.GetEmails(user);

            return(Page());
        }