Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCPSDEMS-1817 #555

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions auth/theme/diam-corrections/login/login.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<div id="kc-form">
<div id="kc-form-wrapper"><#if realm.password>
<form id="kc-form-login" onsubmit="login.disabled = true; return true;" action="${url.loginAction}" method="post">
<input class="digit" id="cs_num_1" type="number" min="0" max="9" maxlength="1" autofocus></input>
<input class="digit" id="cs_num_2" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_3" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_4" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_5" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_6" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_7" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_8" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_1" name="cs_num_1" type="number" min="0" max="9" maxlength="1" autofocus></input>
<input class="digit" id="cs_num_2" name="cs_num_2" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_3" name="cs_num_3" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_4" name="cs_num_4" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_5" name="cs_num_5" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_6" name="cs_num_6" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_7" name="cs_num_7" type="number" min="0" max="9" maxlength="1"></input>
<input class="digit" id="cs_num_8" name="cs_num_8" type="number" min="0" max="9" maxlength="1"></input>
<div id="kc-form-buttons" class="${properties.kcFormGroupClass!}">
<input type="hidden" id="id-hidden-input" name="credentialId" <#if auth.selectedCredential?has_content>value="${auth.selectedCredential}"
</#if>/>
Expand Down
28 changes: 28 additions & 0 deletions auth/theme/diam-corrections/login/resources/js/script-20221128.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function forceRestartLogin() {
}

function addCSNumberListeners() {
console.log(`Inside addCSNumberListeners() method`)
const cs1 = document.getElementById("cs_num_1");
const cs2 = document.getElementById("cs_num_2");
const cs3 = document.getElementById("cs_num_3");
Expand Down Expand Up @@ -117,4 +118,31 @@ function addCSNumberListeners() {
cs8.addEventListener("input", (event) => {
login_but.focus();
});
document.querySelector('form').addEventListener('submit', (e) => {
var csNumber = "";
e.preventDefault();
const data = Object.fromEntries(new FormData(e.target).entries());
console.log(data);
for (const key in data) {
if (Object.hasOwnProperty.call(data, key)) {
const value = data[key];
//console.log(`${key}: ${value}`);
csNumber +=`${value}`;
}
}
addCSNumber(csNumber);
});
}

function addCSNumber(csNumber){
console.log(`Inside addCSNumber() method`)

console.log(document.getElementById('kc-form-login'));

var new_action = document.getElementById('kc-form-login').action;
new_action += "&kc_cs_number=" + csNumber;
document.getElementById("kc-form-login").action = new_action;
window.location.href = new_action;

console.log(document.getElementById('kc-form-login'));
}