diff --git a/Databases/ecobuddy.sqlite b/Databases/ecobuddy.sqlite index 62cde21..aba5aa9 100644 Binary files a/Databases/ecobuddy.sqlite and b/Databases/ecobuddy.sqlite differ diff --git a/Databases/user_credentials.txt b/Databases/user_credentials.txt deleted file mode 100644 index b28078b..0000000 --- a/Databases/user_credentials.txt +++ /dev/null @@ -1,51 +0,0 @@ -Username,Password -Dylan,MirageAutumnUmbrella7 -Lawrence,MirageVictoryKingdom5 -Bryan,EmeraldOrchardLegend3 -Alan,ThunderOceanDiamond2 -Frank,XylophoneVictoryHarmony3 -Logan,NatureSerenityXylophone5 -Jerry,LighthousePhoenixYellow8 -Harold,IcebergGlacierTiger8 -Keith,YachtJourneyGarden4 -Arthur,VictoryOrchardFlower0 -Louis,FlowerNebulaNature3 -Paul,LegendLegendYacht4 -Aaron,RiverCascadeApple3 -George,MeadowBreezePalace4 -Carl,RadianceMirageQuasar2 -Kenneth,IcebergPlanetHorizon8 -Daniel,BreezeXylophoneGalaxy5 -Ronald,PhoenixThunderZephyr2 -Benjamin,NatureVolcanoNebula8 -Joe,UnicornSapphireHorizon1 -Larry,IslandZebraApple6 -Zachary,SapphireUnicornJasmine0 -Willie,UmbrellaVictoryHorizon8 -Anthony,QueenZebraNebula9 -Michael,TigerMountainNightfall8 -Vincent,InfinityHorizonQuicksilver8 -Roger,WinterXylophonePalace8 -Kyle,IcebergDolphinDragon9 -Henry,HarmonyKnightPalace7 -Eugene,JourneyThunderPalace0 -Billy,ThunderThunderQuicksilver9 -Peter,OrchardJasmineVictory4 -Christopher,QueenThunderAutumn5 -Adam,SummerUnicornThunder7 -Nathan,SerenityOrchardThunder2 -Edward,MeadowGalaxyYellow6 -Eric,DolphinNebulaYacht8 -Brian,CastleFlowerGlacier4 -Alexander,ForestSapphireZebra4 -Andrew,GalaxyLemonApple0 -Brandon,HarmonyTigerHarmony2 -Russell,CherryZebraQuicksilver8 -Jack,OrchardZephyrSapphire8 -Jose,BananaJungleSerenity8 -Jacob,KaleidoscopeEmeraldJasmine5 -Dennis,KnightFlowerRainbow2 -Donald,WhisperQuicksilverCastle1 -William,ApplePalaceSummer6 -Patrick,CastleInfinityPhoenix9 -Timothy,YellowEagleSummer0 diff --git a/Views/index.phtml b/Views/index.phtml index 7200fd3..0e14141 100755 --- a/Views/index.phtml +++ b/Views/index.phtml @@ -83,12 +83,12 @@ require('template/header.phtml') // Validate authentication with server first let isAdmin = false; - if (simpleAuth.isAuthenticated()) { + if (auth.isAuthenticated()) { try { // This will validate the token with the server and handle refresh if needed - const isValid = await simpleAuth.validateOnLoad(); + const isValid = await auth.validateOnLoad(); if (isValid) { - isAdmin = simpleAuth.isAdmin(); + isAdmin = auth.isAdmin(); } } catch (error) { console.error('Error validating authentication:', error); diff --git a/Views/template/createModal.phtml b/Views/template/createModal.phtml index 3deb410..01aab45 100755 --- a/Views/template/createModal.phtml +++ b/Views/template/createModal.phtml @@ -96,12 +96,12 @@ createModal.addEventListener('show.bs.modal', async function(event) { // Validate authentication with server first let isAdmin = false; - if (simpleAuth.isAuthenticated()) { + if (auth.isAuthenticated()) { try { // This will validate the token with the server and handle refresh if needed - const isValid = await simpleAuth.validateOnLoad(); + const isValid = await auth.validateOnLoad(); if (isValid) { - isAdmin = simpleAuth.isAdmin(); + isAdmin = auth.isAdmin(); } } catch (error) { console.error('Error validating authentication:', error); diff --git a/Views/template/footer.phtml b/Views/template/footer.phtml index e9d4b6e..940b0f3 100755 --- a/Views/template/footer.phtml +++ b/Views/template/footer.phtml @@ -15,7 +15,7 @@ - + @@ -55,12 +55,12 @@ // initialise CommentsManager CommentsManager.state.isDomReady = true; - if (window.simpleAuth) { + if (window.auth) { CommentsManager.state.isAuthReady = true; CommentsManager.checkinitialise(); } else { - window.addEventListener('simpleAuthReady', () => { - console.log('SimpleAuth is now ready'); + window.addEventListener('authReady', () => { + console.log('auth is now ready'); CommentsManager.state.isAuthReady = true; CommentsManager.checkinitialise(); }); @@ -73,7 +73,7 @@ if (loginForm) { // Show CAPTCHA if needed - if (simpleAuth.needsCaptcha() && captchaContainer) { + if (auth.needsCaptcha() && captchaContainer) { captchaContainer.style.display = 'flex'; } @@ -106,7 +106,7 @@ try { // Attempt login - const result = await simpleAuth.login({ + const result = await auth.login({ username: username, password: password, captchaInput: captchaInput @@ -147,7 +147,7 @@ } // Show CAPTCHA if needed - if (simpleAuth.needsCaptcha() && captchaContainer) { + if (auth.needsCaptcha() && captchaContainer) { captchaContainer.style.display = 'flex'; // Generate new CAPTCHA if needed if (result.captcha) { @@ -178,13 +178,13 @@ if (logoutButton) { logoutButton.addEventListener('click', async (e) => { e.preventDefault(); - await simpleAuth.logout(); + await auth.logout(); }); } // Validate token if authenticated - if (simpleAuth.isAuthenticated()) { - simpleAuth.validateToken().then(valid => { + if (auth.isAuthenticated()) { + auth.validateToken().then(valid => { if (!valid) { if (!localStorage.getItem('validationAttempted')) { localStorage.setItem('validationAttempted', 'true'); diff --git a/Views/template/header.phtml b/Views/template/header.phtml index 6703db6..10ef47e 100755 --- a/Views/template/header.phtml +++ b/Views/template/header.phtml @@ -25,7 +25,7 @@