Feat(Security):
a. Update CORS settings b. Update session cookie settings c. Remove comments that expose project architecture (and that Claude made most of it :P)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import DOM from './dom.js';
|
||||
|
||||
// Module for API calls
|
||||
export default class API {
|
||||
|
||||
static getCsrfToken() {
|
||||
@@ -151,7 +150,6 @@ export default class API {
|
||||
const api = new API();
|
||||
export default api;
|
||||
|
||||
Example of using the API
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
initializeApp();
|
||||
setupEventListeners();
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
|
||||
// Main entry point for the application
|
||||
'use strict';
|
||||
|
||||
// import API from './api.js';
|
||||
import DOM from './dom.js';
|
||||
import Router from './router.js';
|
||||
|
||||
@@ -19,34 +17,24 @@ class App {
|
||||
}
|
||||
|
||||
setupEventListeners() {
|
||||
// Global event listeners
|
||||
// document.addEventListener('click', this.handleGlobalClick.bind(this));
|
||||
// Add more global event listeners as needed
|
||||
}
|
||||
|
||||
handleGlobalClick(event) {
|
||||
// Handle global click events
|
||||
}
|
||||
|
||||
start() {
|
||||
// Additional startup logic
|
||||
this.initPageCurrent();
|
||||
}
|
||||
|
||||
initPageCurrent() {
|
||||
/*
|
||||
_pageCurrent = Router.getPageCurrent();
|
||||
_pageCurrent.initialize();
|
||||
*/
|
||||
this.router.loadPageCurrent();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Application instance
|
||||
const app = new App();
|
||||
|
||||
// DOM ready handler
|
||||
function domReady(fn) {
|
||||
if (document.readyState !== 'loading') {
|
||||
fn();
|
||||
@@ -55,13 +43,10 @@ function domReady(fn) {
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize and start the app when DOM is ready
|
||||
domReady(() => {
|
||||
app.initialize();
|
||||
});
|
||||
|
||||
// Expose app to window for debugging (optional)
|
||||
window.app = app;
|
||||
|
||||
// Export app if using modules
|
||||
export default app;
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
import Validation from "./lib/validation.js";
|
||||
|
||||
// Module for DOM manipulation
|
||||
export default class DOM {
|
||||
static setElementAttributesValuesCurrentAndPrevious(element, data) {
|
||||
DOM.setElementAttributeValueCurrent(element, data);
|
||||
|
||||
@@ -12,30 +12,11 @@ import PageLicense from './pages/legal/license.js';
|
||||
// import PageUserLogout from './pages/user/logout.js';
|
||||
// import PageUserAccount from './pages/user/account.js';
|
||||
|
||||
|
||||
|
||||
import API from './api.js';
|
||||
import DOM from './dom.js';
|
||||
import PagePrivacyPolicy from './pages/legal/privacy_policy.js';
|
||||
import PageRetentionSchedule from './pages/legal/retention_schedule.js';
|
||||
|
||||
// Create a context for the pages
|
||||
// const pagesContext = require.context('./pages', true, /\.js$/);
|
||||
|
||||
/*
|
||||
const pageModules = {
|
||||
// Core
|
||||
[hashPageHome]: () => import('./pages/core/home.js'),
|
||||
[hashPageContact]: () => import('./pages/core/contact.js'),
|
||||
[hashPageServices]: () => import('./pages/core/services.js'),
|
||||
[hashPageAdminHome]: () => import('./pages/core/admin_home.js'),
|
||||
// Legal
|
||||
[hashPageAccessibilityStatement]: () => import('./pages/legal/accessibility_statement.js'),
|
||||
[hashPageLicense]: () => import('./pages/legal/license.js'),
|
||||
// User
|
||||
// Add other pages here...
|
||||
};
|
||||
*/
|
||||
|
||||
export default class Router {
|
||||
constructor() {
|
||||
@@ -146,11 +127,8 @@ export default class Router {
|
||||
}
|
||||
}
|
||||
|
||||
// Create and export a singleton instance
|
||||
export const router = new Router();
|
||||
// import this for navigation
|
||||
|
||||
// Usage example (you can put this in your main.js or app.js)
|
||||
/*
|
||||
router.addRoute('/', () => {
|
||||
console.log('Home page');
|
||||
@@ -162,7 +140,6 @@ router.addRoute('/about', () => {
|
||||
// Load about page content
|
||||
});
|
||||
|
||||
// Example of how to use the router in other parts of your application
|
||||
export function setupNavigationEvents() {
|
||||
document.querySelectorAll('a[data-nav]').forEach(link => {
|
||||
link.addEventListener('click', (e) => {
|
||||
|
||||
Reference in New Issue
Block a user