Skip to content

Commit

Permalink
Extend token validity
Browse files Browse the repository at this point in the history
  • Loading branch information
tfabritius committed Mar 25, 2024
1 parent 3ca8f0f commit 42b1ada
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/service/token_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/tfabritius/plainpage/service/ctxutil"
)

const tokenValidityDuration = 7 * 24 * time.Hour
const tokenValidityDuration = 6 * 30 * 24 * time.Hour // 6 months

func NewTokenService(jwtSecret string) TokenService {
return TokenService{
Expand Down
3 changes: 2 additions & 1 deletion frontend/store/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { FetchError } from 'ofetch'
import { defineStore } from 'pinia'
import type { PatchOperation, TokenUserResponse, User } from '~/types'

const minRemainingTokenValidity = 6 * 24 * 60 * 60 // in seconds
const hour = 60 * 60 // in seconds
const minRemainingTokenValidity = 5 * 30 * 24 * hour // 5 months

export const useAuthStore = defineStore(
'auth',
Expand Down

0 comments on commit 42b1ada

Please sign in to comment.