Middleware javítás
This commit is contained in:
@@ -32,6 +32,13 @@ namespace WorkFlowCheck.Web.Middleware
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Identity.Data;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
@@ -7,6 +8,7 @@ using WorkFlowCheck.Web.Services.Interfaces;
|
||||
|
||||
namespace WorkFlowCheck.Web.Pages.Account
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class LoginModel : PageModel
|
||||
{
|
||||
|
||||
|
||||
+6
-5
@@ -72,11 +72,12 @@
|
||||
},
|
||||
data: JSON.stringify(formData.CheckListTemplateRow),
|
||||
success: function (response) {
|
||||
showMessageModal({
|
||||
title: 'Figyelmem!',
|
||||
message: 'Sikeres mentés.',
|
||||
okText: 'Értettem'
|
||||
});
|
||||
// showMessageModal({
|
||||
// title: 'Figyelmem!',
|
||||
// message: 'Sikeres mentés.',
|
||||
// okText: 'Értettem'
|
||||
// });
|
||||
history.back();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
// Hiba esetén
|
||||
|
||||
Reference in New Issue
Block a user