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 134134 } ;
135135
136136 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' ) ;
139138
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
142141 localStorage . setItem ( 'usernameEnc' , username ) ; // Store the original Base64-encoded username
143142 localStorage . setItem ( 'loggedIn' , 'true' ) ;
144143 window . location . href = 'index.html' ;
163162
164163 function registerScratchAuth ( ) {
165164 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 ` ;
168167
169168 messageBox . style . color = "green" ;
170169 messageBox . textContent = "Redirecting to ScratchAuth... Follow the steps there." ;
You can’t perform that action at this time.
0 commit comments