Ajoutez des fichiers projet.
This commit is contained in:
14
Tagger/Service/UserManager.cs
Normal file
14
Tagger/Service/UserManager.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user