Adapt Neon Theme to Work with ASP.NET Core Razor Pages
Budget: $10 – $30 USD
I have purchased from CodeCanyon the ASP.NET CORE 5.0 Authentication Management (https://codecanyon.net/item/aspnet-core-50-authentication-management/31156842), that comes with the Neon Theme as its framework (https://demo.neontheme.com/extra/login).
The Authentication Management was made in ASP.NET MVC, and I am trying to migrate only the login page to ASP.NET Core with Razor Pages. My problem is that the Login page uses a Jquery function to validate user Authentication, whereas my project does this validation at the Login razor page.
I need to adapt a few lines the of code at NEON-LOGIN.JS file that redirects the user input from the login page to the razor page for validation:
// Send data to the server
$.ajax({
url: '/Identity/Account/LoginFrotiX',
method: 'POST',
dataType: 'json',
headers: {
"content-type": "application/json",
},
data: JSON.stringify({
ponto: $("input#Ponto").val(),
password: $("input#Password").val(),
}),
error: function()
{
alert("Erro ao logar no sistema!");
},
success: function(response)
{
debugger;
// Login status [success|invalid]
var login_status = response.isSuccess;
// Form is fully completed, we update the percentage
neonLogin.setPercentage(100);
// We will give some time for the animation to finish, then execute the following procedures
setTimeout(function()
{
// If login is invalid, we store the
if(!login_status)
{
debugger;
msg = response.message
$(".login-page").removeClass('logging-in');
neonLogin.resetProgressBar(true);
}
else
{
window.localStorage.clear();
window.localStorage.setItem('accessToken', response.content.token);
//
// Redirect to login page
setTimeout(function()
{
var redirect_url = "/intel/analyticsdashboard";
if(response.redirect_url && response.redirect_url.length)
{
redirect_url = response.redirect_url;
}
window.location.href = redirect_url;
return false;
}, 400);
}
}, 1000);
}
});
The Authentication Management was made in ASP.NET MVC, and I am trying to migrate only the login page to ASP.NET Core with Razor Pages. My problem is that the Login page uses a Jquery function to validate user Authentication, whereas my project does this validation at the Login razor page.
I need to adapt a few lines the of code at NEON-LOGIN.JS file that redirects the user input from the login page to the razor page for validation:
// Send data to the server
$.ajax({
url: '/Identity/Account/LoginFrotiX',
method: 'POST',
dataType: 'json',
headers: {
"content-type": "application/json",
},
data: JSON.stringify({
ponto: $("input#Ponto").val(),
password: $("input#Password").val(),
}),
error: function()
{
alert("Erro ao logar no sistema!");
},
success: function(response)
{
debugger;
// Login status [success|invalid]
var login_status = response.isSuccess;
// Form is fully completed, we update the percentage
neonLogin.setPercentage(100);
// We will give some time for the animation to finish, then execute the following procedures
setTimeout(function()
{
// If login is invalid, we store the
if(!login_status)
{
debugger;
msg = response.message
$(".login-page").removeClass('logging-in');
neonLogin.resetProgressBar(true);
}
else
{
window.localStorage.clear();
window.localStorage.setItem('accessToken', response.content.token);
//
// Redirect to login page
setTimeout(function()
{
var redirect_url = "/intel/analyticsdashboard";
if(response.redirect_url && response.redirect_url.length)
{
redirect_url = response.redirect_url;
}
window.location.href = redirect_url;
return false;
}, 400);
}
}, 1000);
}
});