title: Where should I refresh my JWT in SvelteKit
body: <p>I'm trying to implement JWT authentication in a SvelteKit-app and I'm having trouble with where in the code I should refresh my accesstoken on site-reload.
  According to what I have found I should store the JWT in memory and then have a refresh-token that is stored as a HTTP-only cookie. When the page is reloaded or opened in a new tab, I need to call my backend to see if the refresh-token is valid or not, if it is, I will generate a new JWT and return it to the client.</p>
  <p>Where is a good idea to make this call? I was thinking that the <code>getSession</code>-hook would be a good place but I'm not able to use <code>fetch</code> from there.</p>