Skip to content

Commit cb5456d

Browse files
authored
Update account.html
1 parent 49ac3c7 commit cb5456d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/account.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,10 @@
134134
};
135135

136136
function checkAuth() {
137-
const authSuccess = new URLSearchParams(window.location.search).get('success');
138-
const username = new URLSearchParams(window.location.search).get('username');
137+
const PC = new URLSearchParams(window.location.search).get('privateCode');
139138

140-
if (username) {
141-
const decodedUsername = decodeUsername(username); // Decode the username using atob
139+
if (PC) {
140+
const res = await fetch(`https://auth-api.itinerary.eu.org/auth/verifyToken/${PC}`; // Decode the username using atob
142141
localStorage.setItem('usernameEnc', username); // Store the original Base64-encoded username
143142
localStorage.setItem('loggedIn', 'true');
144143
window.location.href = 'index.html';
@@ -163,8 +162,8 @@
163162

164163
function registerScratchAuth() {
165164
const messageBox = document.getElementById("scratchMessage");
166-
const redirectLocation = encodeURIComponent(window.location.href);
167-
const authUrl = `https://scratchauth-codinghut.onrender.com/auth`;
165+
const redirectLocation = btoa(window.location.href);
166+
const authUrl = `https://auth.itinerary.eu.org/auth?redirect=${redirectLocation}&name=Scratch%20Coding%20Hut`;
168167

169168
messageBox.style.color = "green";
170169
messageBox.textContent = "Redirecting to ScratchAuth... Follow the steps there.";

0 commit comments

Comments
 (0)