states: {
active: {
filter: {
type: 'none' /* none, lighten, darken */
allowMultipleDataPointsSelection: false,
}
}
}
async generateTokens(payload) {
const accessToken = await jwt.sign(payload, config.SECRET_KEY_ACCESS_TOKEN, {expiresIn: '15m'})
const refreshToken = await jwt.sign(payload, config.SECRET_KEY_REFRESH_TOKEN, {expiresIn: '30d'})
return {
accessToken,
refreshToken
}
}
function addClass(){
ваш метод. не забудьте проверку, что элемент точно найден
}
addEventListener('DOMContentLoaded', addClass);
function send(event) {
event.preventDefault();
const phone = document.getElementById('phone');
const email = document.getElementById('email');
let classPhone = phone.classList;
let classEmail = email.classList;
if (phone.value === "" && email.value === "") {
classPhone.add ("alert");
classEmail.add ("alert");
}
if (phone.value != "" || email.value != "") {
classPhone.remove ("alert");
classEmail.remove ("alert");
}
}