mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
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:
1 parent
4c8c29b2da
commit
3d26473967
1 file changed
+4
-4
+4
-4
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user