Skip to content

Commit

Permalink
different way of removing magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jun 25, 2023
1 parent 2a93f92 commit 193ebb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webclient/src/composables/feedbackToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export function useFeedbackToken(): {

// Token are renewed much before being invalid on the server.
const MS_PER_HOUR = 3600000;
const TOKEN_VALIDITY_MS = MS_PER_HOUR * 6;
if (token.value === null || Date.now() - token.value.created_at > TOKEN_VALIDITY_MS) {
const TOKEN_VALIDITY_FRONTEND_HOURS = 6;
if (token.value === null || Date.now() - token.value.created_at > TOKEN_VALIDITY_FRONTEND_HOURS * MS_PER_HOUR) {
fetch(`/api/feedback/get_token`, { method: "POST" })
.then((r) => {
if (r.status === TokenStatus.SUCCESSFULLY_CREATED) {
Expand Down

0 comments on commit 193ebb5

Please sign in to comment.