File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 37
37
margin-top : 10px ;
38
38
}
39
39
40
+ .devTokens {
41
+ color : red;
42
+ font-weight : bold;
43
+ margin-top : 10px ;
44
+ }
45
+
40
46
button {
41
47
width : 100% ;
42
48
padding : 12px 20px ;
93
99
return atob ( encodedUsername ) ; // Using atob to decode the Base64 username
94
100
}
95
101
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
+
96
107
// On page load, check if the user is logged in
97
108
window . onload = async function ( ) {
98
109
try {
172
183
async function strikeinfo ( ) {
173
184
window . location . href = `https://scratch-coding-hut.github.io/Strikes/my-strikes?username=${ username } ` ;
174
185
}
186
+
187
+ function devToken ( ) {
188
+ localStorage . removeItem ( 'loggedIn' ) ;
189
+ localStorage . removeItem ( 'username' ) ;
190
+ window . location . href = 'account.html' ;
191
+ }
175
192
</ script >
176
193
</ head >
177
194
@@ -197,6 +214,8 @@ <h2>For You</h2>
197
214
< div class ="container ">
198
215
< h2 > Developer Tokens</ h2 >
199
216
< 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 >
200
219
Coming Soon! Stay tuned
201
220
</ div >
202
221
</ div >
You can’t perform that action at this time.
0 commit comments