15 lines
394 B
C#
15 lines
394 B
C#
using Microsoft.AspNetCore.Components.Authorization;
|
|
|
|
namespace Tagger.Service;
|
|
|
|
public class UserManager
|
|
{
|
|
public async Task<bool> IsLogged(AuthenticationStateProvider stateProvider)
|
|
{
|
|
var authState = await stateProvider.GetAuthenticationStateAsync();
|
|
var user = authState.User;
|
|
return (user.Identity is not null && user.Identity.IsAuthenticated);
|
|
}
|
|
|
|
}
|