prividium 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import { z } from 'zod';
6
6
  import { fastifyHttpProxy } from '@fastify/http-proxy';
7
7
  import { randomBytes } from 'node:crypto';
8
8
  import { log } from '@clack/prompts';
9
+ import { addYears } from 'date-fns/addYears';
9
10
  function fastifyApp() {
10
11
  return Fastify().withTypeProvider();
11
12
  }
@@ -60,6 +61,12 @@ export function buildServer(config) {
60
61
  method: 'GET',
61
62
  headers: { authorization: `Bearer ${req.body.token}` }
62
63
  }).then((res) => {
64
+ if (res.status === 404) {
65
+ return Promise.resolve({
66
+ type: 'user',
67
+ expiresAt: addYears(new Date(), 100)
68
+ });
69
+ }
63
70
  if (!res.ok || res.status !== 200) {
64
71
  throw new Error('Error interacting with api');
65
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prividium",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "bin": {
5
5
  "prividium": "bin/cli.js"
6
6
  },