public async Task <IActionResult> Profile() { var accessToken = HttpContext.Session.GetString(_googleSessionSettings.AccessTokenKey); if (string.IsNullOrEmpty(accessToken)) { return(RedirectToAction("Index", "Home")); } var idToken = HttpContext.Session.GetString(_googleSessionSettings.IdTokenKey); if (string.IsNullOrEmpty(idToken)) { return(RedirectToAction("Index", "Home")); } var userInfo = await _googleService.GetUserInfoFromApi(accessToken); var viewModel = new GoogleProfileViewModel { GoogleId = userInfo.GoogleId, Email = userInfo.Email, IsEmailVerified = userInfo.IsEmailVerified, PictureUrl = userInfo.PictureUrl }; return(View(viewModel)); }