Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions API/Controllers/AuthController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace API.Controllers;

[Route("[controller]")]
public class AuthController: ControllerBase
public class AuthController(ILogger<AuthController> logger): ControllerBase
{
/// <summary>
/// Trigger OIDC login flow
Expand All @@ -33,14 +33,14 @@ public async Task<IActionResult> Logout()
{
if (!Request.Cookies.ContainsKey(OidcService.CookieName))
{
return Redirect("/");
return Redirect("/Auth/login");
}

var res = await HttpContext.AuthenticateAsync(CookieAuthenticationDefaults.AuthenticationScheme);
if (!res.Succeeded || res.Properties == null || string.IsNullOrEmpty(res.Properties.GetString(OidcService.IdToken)))
{
HttpContext.Response.Cookies.Delete(OidcService.CookieName);
return Redirect("/");
return Redirect("/Auth/login");
}

return SignOut(
Expand Down
6 changes: 0 additions & 6 deletions UI/Web/src/app/nav-bar/nav-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ export class NavBarComponent implements OnInit {
ngOnInit(): void {
}

logout() {
this.authService.logout();
}

toggleMobileMenu() {
this.navService.isMobileMenuOpen.update(v => !v);
}
Expand All @@ -88,6 +84,4 @@ export class NavBarComponent implements OnInit {
this.navService.isAccountDropdownOpen.set(false);
}
}

protected readonly main = main;
}