Implement full consent logging system with SQLite database
- Install better-sqlite3 and @astrojs/node adapter - Update consent API to use SQLite database - Add DELETE endpoint for consent logs - Update admin consent-logs page with full UI (stats, table, export, delete) - Add sessionId to consent tracking - Admin password: Coolm@n1234mo Note: Database stored at data/consent.db (gitignored)
This commit is contained in:
@@ -258,10 +258,19 @@ const siteUrl = 'https://dealplustech.co.th';
|
||||
});
|
||||
|
||||
function saveConsent(preferences) {
|
||||
// Get or generate sessionId
|
||||
let sessionId = localStorage.getItem('consent-session-id');
|
||||
if (!sessionId) {
|
||||
sessionId = crypto.randomUUID();
|
||||
localStorage.setItem('consent-session-id', sessionId);
|
||||
}
|
||||
|
||||
const consentData = {
|
||||
...preferences,
|
||||
sessionId,
|
||||
timestamp: Date.now(),
|
||||
policyVersion: '1.0'
|
||||
policyVersion: '1.0',
|
||||
userAgent: navigator.userAgent
|
||||
};
|
||||
localStorage.setItem('consent-preferences', JSON.stringify(consentData));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user