You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
872 B
JavaScript
20 lines
872 B
JavaScript
import { SmsSenderForm } from './component/smsSenderForm.js';
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
// Initialize SMS sender form for password reset
|
|
let $form = document.querySelector('#kc-reset-password-form');
|
|
window._smsSenderForm = new SmsSenderForm("reset-credential", $form);
|
|
|
|
// Handle tab switching to set the validation type
|
|
let tabsBar = document.querySelector('.pf-c-tabsbar');
|
|
if (tabsBar) {
|
|
tabsBar.addEventListener('pf.tab.activate', function(event) {
|
|
console.log(event);
|
|
const tabId = event.detail.tabId;
|
|
let validationTypeInput = document.querySelector('#validation-type');
|
|
validationTypeInput.value = tabId; // 'email' or 'phone'
|
|
});
|
|
} else {
|
|
console.warn("Tabs bar not found for reset password form.");
|
|
}
|
|
}); |