Middleware javítás
This commit is contained in:
@@ -32,6 +32,13 @@ namespace WorkFlowCheck.Web.Middleware
|
|||||||
{
|
{
|
||||||
context.Response.Cookies.Delete("AuthToken");
|
context.Response.Cookies.Delete("AuthToken");
|
||||||
}
|
}
|
||||||
|
var path = context.Request.Path.ToString().ToLower();
|
||||||
|
|
||||||
|
if (!path.StartsWith("/account/login") && !path.StartsWith("/account/register"))
|
||||||
|
{
|
||||||
|
context.Response.Redirect("/Account/Login");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await _next(context);
|
await _next(context);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Identity.Data;
|
using Microsoft.AspNetCore.Identity.Data;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
@@ -7,6 +8,7 @@ using WorkFlowCheck.Web.Services.Interfaces;
|
|||||||
|
|
||||||
namespace WorkFlowCheck.Web.Pages.Account
|
namespace WorkFlowCheck.Web.Pages.Account
|
||||||
{
|
{
|
||||||
|
[AllowAnonymous]
|
||||||
public class LoginModel : PageModel
|
public class LoginModel : PageModel
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -72,11 +72,12 @@
|
|||||||
},
|
},
|
||||||
data: JSON.stringify(formData.CheckListTemplateRow),
|
data: JSON.stringify(formData.CheckListTemplateRow),
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
showMessageModal({
|
// showMessageModal({
|
||||||
title: 'Figyelmem!',
|
// title: 'Figyelmem!',
|
||||||
message: 'Sikeres mentés.',
|
// message: 'Sikeres mentés.',
|
||||||
okText: 'Értettem'
|
// okText: 'Értettem'
|
||||||
});
|
// });
|
||||||
|
history.back();
|
||||||
},
|
},
|
||||||
error: function (xhr, status, error) {
|
error: function (xhr, status, error) {
|
||||||
// Hiba esetén
|
// Hiba esetén
|
||||||
|
|||||||
Reference in New Issue
Block a user