Changeset 6782104 for PostgreSqlDotnetCore/Controllers/PetsController.cs
- Timestamp:
- 08/20/24 16:13:49 (3 months ago)
- Branches:
- main
- Children:
- 63bd770
- Parents:
- 8f8226c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PostgreSqlDotnetCore/Controllers/PetsController.cs
r8f8226c r6782104 19 19 // check for permission 20 20 UsersClass customerClass = await getCrrentUser(); 21 22 // set if is authenticated 23 ViewBag.isAuthenticated = customerClass; 21 24 if (customerClass == null) 22 25 { … … 62 65 //} 63 66 64 public ActionResult Create()67 public async Task<ActionResult> CreateAsync() 65 68 { 66 69 70 // check for permission 71 UsersClass customerClass = await getCrrentUser(); 72 // set if is authenticated 73 ViewBag.isAuthenticated = customerClass; 67 74 return View(); 68 75 } … … 78 85 if (!isAuthenticated) 79 86 { 87 // set if is authenticated 88 ViewBag.isAuthenticated = null; 80 89 return RedirectToAction("AccessDenied", "Error"); 81 90 } 91 ViewBag.isAuthenticated = new UsersClass(); 92 82 93 if (ModelState.IsValid) 83 94 { 84 // peClass.dateofbirthday = DateTime.SpecifyKind(peClass.dateofbirthday, DateTimeKind.Utc); 95 // set if is authenticated 96 ViewBag.isAuthenticated = new UsersClass(); 97 // peClass.dateofbirthday = DateTime.SpecifyKind(peClass.dateofbirthday, DateTimeKind.Utc); 85 98 var user = await _userManager.GetUserAsync(User); 86 99 var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email); … … 121 134 if (!isAuthenticated) 122 135 { 136 // set if is authenticated 137 ViewBag.isAuthenticated = null; 123 138 return RedirectToAction("AccessDenied", "Error"); 124 139 } 140 141 // set if is authenticated 142 ViewBag.isAuthenticated = new UsersClass(); 143 125 144 126 145 if (ModelState.IsValid)
Note:
See TracChangeset
for help on using the changeset viewer.