/ examples / refresh.ts
refresh.ts
 1  import * as izly from "../src";
 2  import { credentials } from "./_credentials";
 3  import { persist, read } from "./_persisted-session";
 4  
 5  void (async function main() {
 6    const identification = await read();
 7  
 8    await izly.refresh(identification, credentials.secret);
 9    // identification mutated, we need to resave it.
10    await persist(identification);
11  
12    console.log("Session refreshed !");
13  }());