Adding Logout, and other misc.
This commit is contained in:
@@ -19,16 +19,6 @@ namespace pointMaster.Controllers
|
||||
|
||||
vm.links = new List<NavUrl>();
|
||||
|
||||
if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
vm.links.Add(new NavUrl("Giv point", "/point/givpoint"));
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.links.Add(new NavUrl("Log ind", "/account/signin"));
|
||||
}
|
||||
|
||||
|
||||
if (HttpContext.User.Claims.FirstOrDefault(x => x.Value == Roles.Editor) != null)
|
||||
{
|
||||
vm.links.Add(new NavUrl("Patruljer", "/Patrulje"));
|
||||
@@ -36,6 +26,16 @@ namespace pointMaster.Controllers
|
||||
vm.links.Add(new NavUrl("Poster", "/Poster"));
|
||||
}
|
||||
|
||||
if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
vm.links.Add(new NavUrl("Giv point", "/point/givpoint"));
|
||||
vm.links.Add(new NavUrl("Log ud", "/account/signout"));
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.links.Add(new NavUrl("Log ind", "/account/signin"));
|
||||
}
|
||||
|
||||
return View(vm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace pointMaster.Controllers
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> SletPost(int id)
|
||||
public ActionResult SletPost(int id)
|
||||
{
|
||||
var post = _context.Poster.Find(id);
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace pointMaster.Controllers
|
||||
|
||||
public class RundeViewModel
|
||||
{
|
||||
public List<Post> Rounds { get; set; }
|
||||
public List<Post> Rounds { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user