INNER CODE UNIT · JavaScript
logIn
dotnetcore/CAP · samples/Sample.Dashboard.Jwt/wwwroot/js/site.js:6
function logIn() {
const userName = $('#userName').val();
const password = $('#password').val();
$.ajax({
method: "POST",
url: "security/createToken",
data: JSON.stringify({ userName, password }),
contentType: "application/json; charset=utf-8",
dataType: "json"
})
.done(token => {
window.open(`/cap/index.html?access_token=${token}`, '_blank')
});
}