File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 134
134
} ;
135
135
136
136
function checkAuth ( ) {
137
- const authSuccess = new URLSearchParams ( window . location . search ) . get ( 'success' ) ;
138
- const username = new URLSearchParams ( window . location . search ) . get ( 'username' ) ;
137
+ const PC = new URLSearchParams ( window . location . search ) . get ( 'privateCode' ) ;
139
138
140
- if ( username ) {
141
- const decodedUsername = decodeUsername ( username ) ; // Decode the username using atob
139
+ if ( PC ) {
140
+ const res = await fetch ( `https://auth-api.itinerary.eu.org/auth/verifyToken/ ${ PC } ` ; // Decode the username using atob
142
141
localStorage . setItem ( 'usernameEnc' , username ) ; // Store the original Base64-encoded username
143
142
localStorage . setItem ( 'loggedIn' , 'true' ) ;
144
143
window . location . href = 'index.html' ;
163
162
164
163
function registerScratchAuth ( ) {
165
164
const messageBox = document . getElementById ( "scratchMessage" ) ;
166
- const redirectLocation = encodeURIComponent ( window . location . href ) ;
167
- const authUrl = `https://scratchauth-codinghut.onrender.com /auth` ;
165
+ const redirectLocation = btoa ( window . location . href ) ;
166
+ const authUrl = `https://auth.itinerary.eu.org /auth?redirect= ${ redirectLocation } &name=Scratch%20Coding%20Hut ` ;
168
167
169
168
messageBox . style . color = "green" ;
170
169
messageBox . textContent = "Redirecting to ScratchAuth... Follow the steps there." ;
You can’t perform that action at this time.
0 commit comments