Skip to content

Commit

Permalink
chore: update token expiry time
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajeyakrishna-k committed Dec 18, 2023
1 parent f045338 commit 9fe53ce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/handlers/scheduledEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const addMissedUpdatesRole = async (env: env) => {
}
cursor = missedUpdatesUsers?.cursor;
}
// add logs for the results https://github.com/Real-Dev-Squad/website-backend/issues/1784
} catch (err) {
console.error('Error while adding missed updates roles');
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/rdsBackendService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getMissedUpdatesUsers = async (env: env, cursor: string | undefined
const responseData: DiscordUsersResponse = await response.json();
return responseData?.data;
} catch (error) {
console.error('Error occurrent while fetching discord user details');
console.error('Error occurred while fetching discord user details');
throw error;
}
};
2 changes: 1 addition & 1 deletion src/tests/services/rdsBackendService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('rdsBackendService', () => {
const consoleSpy = jest.spyOn(console, 'error');
jest.spyOn(global, 'fetch').mockRejectedValueOnce(new Error('Error occurred'));
await expect(getMissedUpdatesUsers({}, cursor)).rejects.toThrow('Error occurred');
expect(consoleSpy).toHaveBeenCalledWith('Error occurrent while fetching discord user details');
expect(consoleSpy).toHaveBeenCalledWith('Error occurred while fetching discord user details');
});
});
});
4 changes: 2 additions & 2 deletions src/utils/generateJwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const generateJwt = async (env: env) => {
const authToken = await jwt.sign(
{
name: 'Cron Job Handler',
exp: Math.floor(Date.now() / 1000) + 2,
exp: Math.floor(Date.now() / 1000) + 60,
},
env.CRON_JOB_PRIVATE_KEY,
{ algorithm: 'RS256' },
Expand All @@ -23,7 +23,7 @@ export const generateDiscordBotJwt = async (env: env) => {
try {
const authToken = await jwt.sign(
{
exp: Math.floor(Date.now() / 1000) + 2,
exp: Math.floor(Date.now() / 1000) + 60,
},
env.DISCORD_BOT_PRIVATE_KEY,
{ algorithm: 'RS256' },
Expand Down

0 comments on commit 9fe53ce

Please sign in to comment.