/*public async Task<IActionResult> OnGetAsync()
         * {
         *  var user = await _userManager.GetUserAsync(User);
         *
         *  user.Attributes[CognitoAttribute.Address.AttributeName] = "ssssss";
         *  //await user.UpdateAttributesAsync(user.Attributes);
         *  var result = await _userManager.UpdateAsync(user);
         *  Console.WriteLine("cool");
         *  if (user == null)
         *  {
         *      return NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
         *  }
         * Input = new AccountModel()
         *  {
         *      Address = user.Attributes[CognitoAttribute.Address.AttributeName]
         *  };
         *
         *
         *
         *
         *  return Page();
         * }*/
        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)}'."));
            }

            await LoadAsync(user);

            //user.Attributes.Add(CognitoAttribute.Address.AttributeName, "2251 pimmit dr");
            return(Page());
        }
Exemple #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)}'."));
            }

            await LoadAsync(user);


            return(Page());
        }
 public async Task OnGetAsync(string message = null)
 {
     Message  = HttpUtility.UrlDecode(message);
     SignedIn = signInManager.IsSignedIn(User);
     CUser    = await userManager.GetUserAsync(User);
 }