Auth System
This commit is contained in:
17
FoodsharingSiegen.Server/Pages/Logout.razor
Normal file
17
FoodsharingSiegen.Server/Pages/Logout.razor
Normal file
@@ -0,0 +1,17 @@
|
||||
@layout LoginLayout
|
||||
@page "/logout"
|
||||
@using FoodsharingSiegen.Server.Service
|
||||
@using FoodsharingSiegen.Server.Auth
|
||||
|
||||
@inject AuthService AuthService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
@code {
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var logoutR = await AuthService.Logout();
|
||||
if(logoutR.Success) NavigationManager.NavigateTo("/");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user