Skip to content

Commit 0a15032

Browse files
authored
Update account.html
Got rid of the username input.
1 parent 014541e commit 0a15032

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

account.html

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,16 @@
2424
color: red;
2525
font-weight: bold;
2626
}
27-
input, button {
27+
button {
2828
padding: 10px;
2929
margin: 10px;
3030
font-size: 16px;
3131
}
3232
</style>
3333
<script>
3434
function registerUser() {
35-
const username = document.getElementById("username").value.trim();
3635
const messageBox = document.getElementById("message");
3736

38-
if (!username) {
39-
messageBox.textContent = "Please enter a Scratch username.";
40-
return;
41-
}
42-
4337
const redirectLocation = encodeURIComponent(window.location.href);
4438
const authUrl = `https://auth.itinerary.eu.org/auth/?redirect=${redirectLocation}&name=Coding%20Hut&sign_in_method=cloud`;
4539

@@ -50,30 +44,27 @@
5044
window.location.href = authUrl;
5145
}, 2000);
5246
}
53-
// Simulate checking if the user is logged in
54-
function checkAuth() {
55-
const urlParams = new URLSearchParams(window.location.search);
56-
const authSuccess = urlParams.get('success');// Example: Scratch Auth might return '?success=true'
57-
const username = params.get('username');
58-
59-
if (authSuccess === 'true') {
60-
// Redirect to index.html if login was successful
61-
localStorage.setItem('loggedIn', 'true');
62-
window.location.href = 'index.html';
47+
48+
// Simulate checking if the user is logged in
49+
function checkAuth() {
50+
const urlParams = new URLSearchParams(window.location.search);
51+
const authSuccess = urlParams.get('success'); // Example: Scratch Auth might return '?success=true'
52+
53+
if (authSuccess === 'true') {
54+
// Redirect to index.html if login was successful
55+
localStorage.setItem('loggedIn', 'true');
56+
window.location.href = 'index.html';
57+
}
6358
}
64-
}
6559

66-
// Run this check when the page loads
67-
window.onload = checkAuth;
60+
// Run this check when the page loads
61+
window.onload = checkAuth;
6862
</script>
6963
</head>
7064
<body>
7165
<div class="header"><h1>Scratch Authentication</h1></div>
7266
<div class="content">
7367
<h2>Welcome! Please log in to continue.</h2>
74-
<label for="username">Scratch Username:</label>
75-
<input type="text" id="username" placeholder="Enter your Scratch username" />
76-
<br />
7768
<button onclick="registerUser()">Register</button>
7869
<p id="message" class="message"></p>
7970
<p>

0 commit comments

Comments
 (0)