You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constusername=urlParams.get('username');// Get the username parameter from the URL
103
-
104
-
if(username){
105
-
localStorage.setItem('username',username);// Store the username in localStorage
106
-
localStorage.setItem('loggedIn','true');// Mark the user as logged in
107
-
window.location.href='index.html';// Redirect to the main dashboard or home page
108
-
}
109
-
110
-
// If success is true (from ScratchAuth)
111
-
if(authSuccess==='true'){
112
-
localStorage.setItem('loggedIn','true');
113
-
window.location.href='index.html';
114
-
}
115
-
}
116
-
117
-
window.onload=checkAuth;// Call checkAuth when the page loads to handle login status
118
-
119
-
if(localStorage.getItem('loggedIn')==='true'){
120
-
window.location.href='index.html';// Redirect to the dashboard if already logged in
121
-
}
122
-
checkAuth()
123
-
constuser=localStorage.getItem('username')
124
-
consttext=document.getElementById('text');
125
-
constloggedIn=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
-
}
131
124
</script>
132
125
</head>
133
126
<body>
@@ -145,14 +138,13 @@ <h2>Welcome! Please log in to continue.</h2>
145
138
choose the "Cloud Data" option for the quickest sign-in method.
146
139
147
140
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>
148
-
149
141
</div>
150
142
151
143
<divid="text" class="container">
152
144
<h2>Login Using APIAuth</h2>
153
-
<buttononclick="registerApiAuth()">Login With APIAuth (Made by <ahref="https://scratch.mit.edu/users/kRxZy_kRxZy/" target="_blank" style="color: black">kRxZy_kRxZy</a>)</button>
145
+
<buttononclick="registerApiAuth()">Login With APIAuth (Made by <ahref="https://scratch.mit.edu/users/kRxZy_kRxZy/" target="_blank" style="color: blue">kRxZy_kRxZy</a>)</button>
0 commit comments