Skip to content

Commit 5a095a4

Browse files
authored
Update account.html
1 parent 4b32502 commit 5a095a4

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

account.html

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,32 +120,39 @@
120120
window.location.href = 'index.html'; // Redirect to the dashboard if already logged in
121121
}
122122
checkAuth()
123+
const user = localStorage.getItem('username')
124+
const text = document.getElementById('text');
125+
const loggedIn = document.getElementById('loggedIn')
126+
if (username) {
127+
text.style.display = 'none';
128+
loggedIn.style.display = 'block';
129+
loggedIn.textContent = `Welcome to your account ${username}!`
130+
}
123131
</script>
124132
</head>
125133
<body>
126-
<div class="header">
134+
<div id="text" class="header">
127135
<h1>Scratch Authentication</h1>
128136
</div>
137+
<div id="loggedIn" class="header"></div>
129138

130-
<div class="content">
139+
<div id="text" class="content">
131140
<h2>Welcome! Please log in to continue.</h2>
132141
<button onclick="registerScratchAuth()">Register With ScratchAuth</button>
133-
<p id="message" class="message" aria-live="polite"></p>
134-
<p>
142+
<p id="message" id="text" class="message" aria-live="polite"></p>
143+
<p id="text">
135144
Please note: You will be redirected to an external site (ScratchAuth) for authentication. Once there,
136145
choose the "Cloud Data" option for the quickest sign-in method.
137-
</p>
138-
<p>
139-
If you are unable to use the "Cloud Data" option, other sign-in methods are available on Scratch Auth's page, for example, profile commenting.
140-
</p>
146+
147+
If you are unable to use the "Cloud Data" option, other sign-in methods are available on Scratch Auth's page, for example, profile commenting.</p>
141148

142149
</div>
143150

144-
<div class="container">
151+
<div id="text" class="container">
145152
<h2>Login Using APIAuth</h2>
146153
<button onclick="registerApiAuth()">Login With APIAuth (Made by <a href="https://scratch.mit.edu/users/kRxZy_kRxZy/" target="_blank" style="color: black">kRxZy_kRxZy</a>)</button>
147154
</div>
148-
<div class="container"><a href="https://github.com/Scratch-Coding-Hut/Scratch-Coding-Hut.github.io/issues/new">
155+
<div id="text" class="container"><a href="https://github.com/Scratch-Coding-Hut/Scratch-Coding-Hut.github.io/issues/new">
149156
<button>Having trouble signing in? Report an issue</button></a><div>
150157
</body>
151158
</html>

0 commit comments

Comments
 (0)