Fas 1a: product analytics schema + GDPR controls
This commit is contained in:
@@ -54,6 +54,16 @@ export async function authRoutes(app: FastifyInstance) {
|
||||
.values({ userId: user.id })
|
||||
.onConflictDoNothing();
|
||||
|
||||
// Product analytics: legitimate interest with opt-out (spec §8, §33).
|
||||
const consentNow = new Date();
|
||||
await app.db.insert(schema.userConsents).values({
|
||||
userId: user.id,
|
||||
kind: "product_analytics",
|
||||
status: "granted",
|
||||
grantedAt: consentNow,
|
||||
updatedAt: consentNow,
|
||||
});
|
||||
|
||||
// 7 dagars trial utan kort startar direkt (spec §46)
|
||||
const now = new Date();
|
||||
await app.db
|
||||
|
||||
Reference in New Issue
Block a user