const redirectBtn = document.getElementById("redirectBtn"); const authQueryParams = { client_id: "assistants-atelier-js", scope: "epita profile picture", redirect_uri: "http://localhost:8080/complete/epita/", response_type: "code", }; const authEndpoint = "https://cri.epita.fr/authorize"; window.LOGIN_URL = new URL( `?client_id=${authQueryParams.client_id}&scope=${authQueryParams.scope}&redirect_uri=${authQueryParams.redirect_uri}&response_type=${authQueryParams.response_type}`, authEndpoint, ); redirectBtn.addEventListener("click", () => { window.location.replace(window.LOGIN_URL); });