Update token expiration calculation to 60 days for managed pages

Adjusted the token expiration calculation from 90 days to 60 days in server/routes.ts for both new page registrations and access token updates.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 8f8a8bbf-c2e3-4e22-b512-22aeb9e46ecf
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/C5fWcTz
This commit is contained in:
michaelschal committed 2025-11-18 19:05:33 +00:00
1 parent 4c8c29b2da
commit 3d26473967
1 file changed
+4 -4
+4 -4
View File
@@ -1247,9 +1247,9 @@ export async function registerRoutes(app: Express): Promise<Server> {
const user = req.user as User;
const userId = user.id;
// Calculate token expiration date (90 days from now)
// Calculate token expiration date (60 days from now)
const tokenExpiresAt = new Date();
tokenExpiresAt.setDate(tokenExpiresAt.getDate() + 90);
tokenExpiresAt.setDate(tokenExpiresAt.getDate() + 60);
const pageData = insertSocialPageSchema.parse({
...req.body,
@@ -1277,10 +1277,10 @@ export async function registerRoutes(app: Express): Promise<Server> {
let pageData = insertSocialPageSchema.partial().parse(req.body);
// If accessToken is being updated, recalculate expiration date (90 days from now)
// If accessToken is being updated, recalculate expiration date (60 days from now)
if (pageData.accessToken) {
const tokenExpiresAt = new Date();
tokenExpiresAt.setDate(tokenExpiresAt.getDate() + 90);
tokenExpiresAt.setDate(tokenExpiresAt.getDate() + 60);
pageData = { ...pageData, tokenExpiresAt };
}