@axium/server 0.6.0 → 0.6.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.
package/dist/cli.js CHANGED
@@ -198,7 +198,7 @@ program
198
198
  if (!plugin.statusText)
199
199
  continue;
200
200
  console.log(styleText('bold', plugin.name + ':'));
201
- console.log(plugin.statusText());
201
+ console.log(await plugin.statusText());
202
202
  }
203
203
  });
204
204
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/server",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "funding": {
6
6
  "type": "individual",
package/web/auth.ts CHANGED
@@ -2,11 +2,11 @@ import { SvelteKitAuth } from '@auth/sveltekit';
2
2
  import { createWriteStream } from 'node:fs';
3
3
  import { join } from 'node:path/posix';
4
4
  import { getConfig } from '../dist/auth.js';
5
- import { loadDefaults as loadDefaultConfigs } from '../dist/config.js';
5
+ import config from '../dist/config.js';
6
6
  import { findDir, logger } from '../dist/io.js';
7
7
  import { allLogLevels } from 'logzen';
8
8
 
9
9
  logger.attach(createWriteStream(join(findDir(false), 'server.log')), { output: allLogLevels });
10
- loadDefaultConfigs();
10
+ config.loadDefaults();
11
11
 
12
12
  export const { handle, signIn, signOut } = SvelteKitAuth(getConfig());
@@ -1,5 +1,5 @@
1
1
  import { redirect } from '@sveltejs/kit';
2
- import * as config from '../../../dist/config.js';
2
+ import config from '../../../dist/config.js';
3
3
  import { signup } from '../../actions.js';
4
4
  import type { Actions } from './$types.js';
5
5
 
package/web/utils.ts CHANGED
@@ -3,12 +3,12 @@ import type { ActionFailure, RequestEvent } from '@sveltejs/kit';
3
3
  import { fail, redirect } from '@sveltejs/kit';
4
4
  import type * as z from 'zod';
5
5
  import { fromError } from 'zod-validation-error';
6
- import { web } from '../dist/config.js';
6
+ import config from '../dist/config.js';
7
7
 
8
8
  export async function loadSession(event: RequestEvent): Promise<{ session: Session }> {
9
9
  const session = await event.locals.auth();
10
10
  if (!session) redirect(307, '/auth/signin');
11
- if (!session.user.name && event.url.pathname != web.prefix + '/name') redirect(307, web.prefix + '/name');
11
+ if (!session.user.name && event.url.pathname != config.web.prefix + '/name') redirect(307, config.web.prefix + '/name');
12
12
  return { session };
13
13
  }
14
14