@nekm/svelte-core 1.7.3 → 1.7.4

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.
@@ -1,4 +1,9 @@
1
1
  import type { Handle, RequestEvent } from "@sveltejs/kit";
2
+ export interface ProtectTokens<TAuthToken = unknown, TIdToken = unknown, TAccessToken = unknown> {
3
+ readonly auth: TAuthToken;
4
+ readonly id: TIdToken;
5
+ readonly access: TAccessToken;
6
+ }
2
7
  export interface ProtectConfig<TAuthToken = unknown, TIdToken = unknown, TAccessToken = unknown> {
3
8
  readonly protect?: (event: RequestEvent) => Promise<boolean> | boolean;
4
9
  readonly jwtDecodeAndVerifyIdToken: (token: string) => Promise<TIdToken> | TIdToken;
@@ -9,8 +14,8 @@ export interface ProtectConfig<TAuthToken = unknown, TIdToken = unknown, TAccess
9
14
  readonly stateGet: (event: RequestEvent) => Promise<string> | string;
10
15
  };
11
16
  readonly hooks?: {
12
- readonly onLogout?: () => Promise<void> | void;
13
- readonly onLogin?: (authToken: TAuthToken, idToken: TIdToken, accessToken: TAccessToken) => Promise<void> | void;
17
+ readonly onLogout?: (event: RequestEvent) => Promise<void> | void;
18
+ readonly onLogin?: (event: RequestEvent, tokens: ProtectTokens<TAuthToken, TIdToken, TAccessToken>) => Promise<void> | void;
14
19
  };
15
20
  readonly oauth: {
16
21
  readonly clientId: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@nekm/svelte-core",
3
3
  "description": "Code I find myself re-writing over-and-over, Svelte edition.",
4
4
  "license": "MIT",
5
- "version": "1.7.3",
5
+ "version": "1.7.4",
6
6
  "scripts": {
7
7
  "dev": "vite dev",
8
8
  "build": "vite build && npm run prepack",