Skip to content

Commit 4ca9aed

Browse files
authored
Update account.html
1 parent b3e8958 commit 4ca9aed

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/account.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
margin-top: 10px;
3838
}
3939

40+
.devTokens {
41+
color: red;
42+
font-weight: bold;
43+
margin-top: 10px;
44+
}
45+
4046
button {
4147
width: 100%;
4248
padding: 12px 20px;
@@ -93,6 +99,11 @@
9399
return atob(encodedUsername); // Using atob to decode the Base64 username
94100
}
95101

102+
// Function to encode the username using btoa() (Base64 encoding)
103+
function decodeUsername(encodedUsername) {
104+
return btoa(encodedUsername); // Using atob to encode the Base64 username
105+
}
106+
96107
// On page load, check if the user is logged in
97108
window.onload = async function () {
98109
try {
@@ -172,6 +183,12 @@
172183
async function strikeinfo() {
173184
window.location.href = `https://scratch-coding-hut.github.io/Strikes/my-strikes?username=${username}`;
174185
}
186+
187+
function devToken() {
188+
localStorage.removeItem('loggedIn');
189+
localStorage.removeItem('username');
190+
window.location.href = 'account.html';
191+
}
175192
</script>
176193
</head>
177194

@@ -197,6 +214,8 @@ <h2>For You</h2>
197214
<div class="container">
198215
<h2>Developer Tokens</h2>
199216
<h3>Used for linking Scratch account to forums account</h3>
217+
<p id="devTokens" class="message" aria-live="polite"></p>
218+
<button onclick="logout()">Generate Dev Token</button>
200219
Coming Soon! Stay tuned
201220
</div>
202221
</div>

0 commit comments

Comments
 (0)