Claim Logic
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Server.Auth;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace FoodsharingSiegen.Server.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// The fs base class (a. beging, 08.04.2022)
|
||||
/// </summary>
|
||||
/// <seealso cref="ComponentBase"/>
|
||||
public class FsBase : ComponentBase
|
||||
{
|
||||
#region Dependencies (Injected)
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the auth service (ab)
|
||||
/// </summary>
|
||||
[Inject] private AuthService? AuthService { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Override OnInitializedAsync
|
||||
|
||||
/// <summary>
|
||||
/// Ons the initialized (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await AuthService!.Initialize();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of the current user (ab)
|
||||
/// </summary>
|
||||
protected User CurrentUser => AuthService?.User ?? new User();
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
@using FoodsharingSiegen.Server.Controls
|
||||
@using FoodsharingSiegen.Contracts.Entity
|
||||
@using FoodsharingSiegen.Contracts.Helper
|
||||
@using FoodsharingSiegen.Server.BaseClasses
|
||||
|
||||
@inherits FsBase
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@page "/users"
|
||||
@using FoodsharingSiegen.Contracts.Entity
|
||||
|
||||
@inherits FsBase
|
||||
@inherits FoodsharingSiegen.Server.BaseClasses.FsBase
|
||||
|
||||
@code {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user