htmx-router 0.0.12 → 0.0.13

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/bin/router.js CHANGED
@@ -51,8 +51,10 @@ class RouteLeaf {
51
51
  }
52
52
  async render(args, mask, routeName) {
53
53
  try {
54
+ // Always check auth
55
+ // If auth error this function will throw
54
56
  if (this.module.Auth)
55
- return await this.module.Auth(args);
57
+ await this.module.Auth(args);
56
58
  if (mask === render_args_1.MaskType.show) {
57
59
  if (this.module.Render)
58
60
  return await this.module.Render(routeName, args);
package/bin/shared.d.ts CHANGED
@@ -5,7 +5,7 @@ import { RenderArgs } from "./render-args";
5
5
  export type Outlet = () => Promise<string>;
6
6
  export type CatchFunction = (routeName: string, args: RenderArgs, err: ErrorResponse) => Promise<string>;
7
7
  export type RenderFunction = (routeName: string, args: RenderArgs) => Promise<string>;
8
- export type AuthFunction = (args: RenderArgs) => Promise<string>;
8
+ export type AuthFunction = (args: RenderArgs) => Promise<void>;
9
9
  export type RouteModule = {
10
10
  Render?: RenderFunction;
11
11
  CatchError?: CatchFunction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htmx-router",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "A remix.js style file path router for htmX websites",
5
5
  "main": "./bin/index.js",
6
6
  "scripts": {