Merge branch 'master' of https://tfs.nuvolar.hu:8443/tfs/AtomERP/_git/WorkFlowCheck
This commit is contained in:
@@ -46,4 +46,10 @@
|
||||
<Folder Include="logs\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Update="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -135,7 +135,17 @@ namespace WorkFlowCheck.BL.Services
|
||||
.FirstOrDefaultAsync();
|
||||
if (user != null && PasswordHasher.VerifyPassword(user.PasswordHash, password))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(user.Email))
|
||||
var canUseWebAdmin = false;
|
||||
foreach (var userRole in user.UserRoles)
|
||||
{
|
||||
if (userRole.Role.CanUseWebAdmin)
|
||||
{
|
||||
canUseWebAdmin = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(user.Email) && canUseWebAdmin)
|
||||
{
|
||||
var code = CodeGenerator2F.GenerateSixDigitCode();
|
||||
|
||||
|
||||
@@ -23,10 +23,7 @@
|
||||
<div class="card shadow p-4" style="min-width: 350px; max-width: 400px; width: 100%;">
|
||||
<h2 class="mb-4 text-center">Bejelentkezés</h2>
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
{
|
||||
<div class="alert alert-danger">@Model.ErrorMessage</div>
|
||||
}
|
||||
<div id="errorMessageContainer" class="alert alert-danger" style="display:none;"></div>
|
||||
|
||||
<form method="post">
|
||||
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
|
||||
@@ -69,6 +66,8 @@
|
||||
$('#Login2F2Btn').hide();
|
||||
|
||||
$('#Login2F1Btn').on('click', function () {
|
||||
// $('#Login2F1Btn, #Login2F2Btn').prop('disabled', true);
|
||||
$('#errorMessageContainer').hide().text('');
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
||||
const userName = $('#User2FADTO_UserName').val();
|
||||
const password = $('#User2FADTO_Password').val();
|
||||
@@ -94,17 +93,27 @@
|
||||
$('#Login2F2Btn').show();
|
||||
$('#User2FADTO_Token2FA').val(result.data)
|
||||
} else {
|
||||
alert('Hibás felhasználónév vagy jelszó!');
|
||||
$('#errorMessageContainer').text('Hibás felhasználónév vagy jelszó!').show();
|
||||
// $('#Login2F1Btn, #Login2F2Btn')
|
||||
// .prop('disabled', false)
|
||||
// .removeAttr('disabled')
|
||||
// .removeClass('disabled');
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert('Hiba történt a kérés során.');
|
||||
$('#errorMessageContainer').text('Hiba történt a kérés során.').show();
|
||||
// $('#Login2F1Btn, #Login2F2Btn')
|
||||
// .prop('disabled', false)
|
||||
// .removeAttr('disabled')
|
||||
// .removeClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#Login2F2Btn').on('click', function () {
|
||||
// $('#Login2F1Btn, #Login2F2Btn').prop('disabled', true);
|
||||
$('#errorMessageContainer').hide().text('');
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
||||
|
||||
const userName = $('#User2FADTO_UserName').val();
|
||||
@@ -130,16 +139,27 @@
|
||||
if (result.success) {
|
||||
window.location.href = `/Index`;
|
||||
} else {
|
||||
alert('Hibás felhasználónév vagy jelszó!');
|
||||
$('#errorMessageContainer').text('Hibás felhasználónév vagy jelszó!').show();
|
||||
// $('#Login2F1Btn, #Login2F2Btn')
|
||||
// .prop('disabled', false)
|
||||
// .removeAttr('disabled')
|
||||
// .removeClass('disabled');
|
||||
}
|
||||
},
|
||||
error: function (xhr) {
|
||||
console.log(xhr.status);
|
||||
console.log(xhr.responseText);
|
||||
alert('Hiba történt a kérés során.');
|
||||
$('#errorMessageContainer').text('Hiba történt a kérés során.').show();
|
||||
// $('#Login2F1Btn, #Login2F2Btn')
|
||||
// .prop('disabled', false)
|
||||
// .removeAttr('disabled')
|
||||
// .removeClass('disabled');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('input').on('input', function () {
|
||||
$('#errorMessageContainer').hide().text('');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© @DateTime.Now.Year - Workflow Check App - Version 0.899<a asp-area="" asp-page="/Privacy">Privacy</a>
|
||||
© @DateTime.Now.Year - Workflow Check App - Version v1.1.003 <a asp-area="" asp-page="/Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
||||
@@ -40,4 +40,9 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WorkFlowCheck.Common\WorkFlowCheck.Common.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Update="appsettings.Development.json">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user