Automatic connexion

arthur_usercookies
Arthur VALIN 2 years ago
parent 249df5cfe0
commit 1af61f0c5d

@ -22,7 +22,8 @@ namespace CraftSharp.Controllers
this.HttpContext.Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,
CookieRequestCultureProvider.MakeCookieValue(
new RequestCulture(culture)));
new RequestCulture(culture))
);
}
return this.LocalRedirect(redirectUri);

@ -26,6 +26,15 @@ namespace CraftSharp.Pages
private string error { get; set; }
private ConnexionModel loginRequest { get; set; } = new ConnexionModel();
protected override async Task OnInitializedAsync()
{
if (AuthStateProvider.GetCurrentUser() != null && AuthStateProvider.GetCurrentUser().IsAuthenticated)
{
NavigationManager.NavigateTo("index");
}
}
private async Task OnSubmit()
{
error = null;

@ -24,6 +24,14 @@ namespace CraftSharp.Pages
private string error { get; set; }
private InscriptionModel registerRequest { get; set; } = new InscriptionModel();
protected override async Task OnInitializedAsync()
{
if (AuthStateProvider.GetCurrentUser() != null && AuthStateProvider.GetCurrentUser().IsAuthenticated)
{
NavigationManager.NavigateTo("index");
}
}
private async Task OnSubmit()
{

Loading…
Cancel
Save