Skip to content

Commit

Permalink
fix(refresh): prevent scheduled refresh from being executed in server…
Browse files Browse the repository at this point in the history
… side
  • Loading branch information
JoaoPedroAS51 committed Mar 9, 2020
1 parent 0dc1af3 commit eb38fd4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/core/refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export class RefreshController {
// Call this function once from your mounted hook, client side
// ---------------------------------------------------------------
initializeScheduledRefresh () {
// If is server side, bail
if (process.server) return

let intervalDuration = (this.scheme._getTokenExpiration() - Date.now()) * 0.75
if (intervalDuration < 1000) {
// in case you misconfigured refreshing this will save your auth-server from a self-induced DDoS-Attack
Expand Down

0 comments on commit eb38fd4

Please sign in to comment.