This commit is contained in:
krugarrr 2024-01-17 18:38:14 +03:00
parent 135df93d49
commit eafb53bc4a

View file

@ -60,11 +60,11 @@
const userLogin = document.querySelector('input[name="user_login"]').value;
const clientSecret = document.querySelector('input[name="client_secret"]').value;
const backRedirectionAddress = new URLSearchParams(window.location.search).get('back_redirection_address');
fetch('http://auth-server/login?user_login=${userLogin}&client_secret=${clientSecret}')
fetch(`http://auth-server/login?user_login=${userLogin}&client_secret=${clientSecret}`)
.then(response => response.json())
.then(data => {
const accessToken = data.access_token;
window.location.href = '${backRedirectionAddress}?access_token=${accessToken}&user_login=${userLogin}';
window.location.href = `${backRedirectionAddress}?access_token=${accessToken}&user_login=${userLogin}`;
})
.catch(error => console.error(error));
});