@crossauth/sveltekit 0.0.37 → 0.0.39

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.
@@ -486,17 +486,6 @@ export declare class SvelteKitOAuthClient extends OAuthClientBackend {
486
486
  access_token?: string | undefined;
487
487
  refresh_token?: string | undefined;
488
488
  id_token?: string | undefined;
489
- /**
490
- * This function is called after successful authorization to pass the
491
- * new tokens to.
492
- * @param oauthResponse the response from the OAuth `token` endpoint.
493
- * @param client the OAuth client
494
- * @param event the SvelteKit request event
495
- * @param silent if true, don't return a Response, only JSON or undefined.
496
- * @param setUserFn if implementing this function you should call this
497
- * when you receive a valid ID token
498
- * @returns a Response, JSON or undefined
499
- */
500
489
  id_payload?: {
501
490
  [key: string]: any;
502
491
  } | undefined;
@@ -524,17 +513,6 @@ export declare class SvelteKitOAuthClient extends OAuthClientBackend {
524
513
  access_token?: string | undefined;
525
514
  refresh_token?: string | undefined;
526
515
  id_token?: string | undefined;
527
- /**
528
- * This function is called after successful authorization to pass the
529
- * new tokens to.
530
- * @param oauthResponse the response from the OAuth `token` endpoint.
531
- * @param client the OAuth client
532
- * @param event the SvelteKit request event
533
- * @param silent if true, don't return a Response, only JSON or undefined.
534
- * @param setUserFn if implementing this function you should call this
535
- * when you receive a valid ID token
536
- * @returns a Response, JSON or undefined
537
- */
538
516
  id_payload?: {
539
517
  [key: string]: any;
540
518
  } | undefined;
@@ -560,17 +538,6 @@ export declare class SvelteKitOAuthClient extends OAuthClientBackend {
560
538
  access_token?: string | undefined;
561
539
  refresh_token?: string | undefined;
562
540
  id_token?: string | undefined;
563
- /**
564
- * This function is called after successful authorization to pass the
565
- * new tokens to.
566
- * @param oauthResponse the response from the OAuth `token` endpoint.
567
- * @param client the OAuth client
568
- * @param event the SvelteKit request event
569
- * @param silent if true, don't return a Response, only JSON or undefined.
570
- * @param setUserFn if implementing this function you should call this
571
- * when you receive a valid ID token
572
- * @returns a Response, JSON or undefined
573
- */
574
541
  id_payload?: {
575
542
  [key: string]: any;
576
543
  } | undefined;
@@ -40,9 +40,15 @@ export interface SvelteKitSessionServerOptions extends SessionManagerOptions {
40
40
  /**
41
41
  * URL to call when login is required.
42
42
  *
43
- * Default "/"
43
+ * Default "/login"
44
44
  */
45
45
  loginUrl?: string;
46
+ /**
47
+ * URL to call to logout.
48
+ *
49
+ * Default "/logout"
50
+ */
51
+ logoutUrl?: string;
46
52
  /**
47
53
  * Default URL to go to after login (can be overridden by `next` POST param)
48
54
  *
@@ -52,21 +58,27 @@ export interface SvelteKitSessionServerOptions extends SessionManagerOptions {
52
58
  /**
53
59
  * URL to call when change password is required.
54
60
  *
55
- * Default "/changepassword"
61
+ * No default.
56
62
  */
57
63
  changePasswordUrl?: string;
58
64
  /**
59
65
  * URL to call when change password is required.
60
66
  *
61
- * Default "/resetpassword"
67
+ * No default.
62
68
  */
63
69
  requestPasswordResetUrl?: string;
64
70
  /**
65
71
  * URL to call when change factor2 is required.
66
72
  *
67
- * Default "/changefactor2"
73
+ * No default.
68
74
  */
69
75
  changeFactor2Url?: string;
76
+ /**
77
+ * URL to call when reconfiguring factor2 is required.
78
+ *
79
+ * No default.
80
+ */
81
+ configureFactor2Url?: string;
70
82
  /** OAuth to support. A comma-separated list from {@link @crossauth/common!OAuthFlows}.
71
83
  * If [`all`], there must be none other in the list.
72
84
  *
@@ -300,6 +312,7 @@ export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
300
312
  event: RequestEvent;
301
313
  }) => MaybePromise<{
302
314
  headers: Header[];
315
+ status?: number;
303
316
  }>;
304
317
  readonly twoFAHook: (input: {
305
318
  event: RequestEvent;
@@ -412,6 +425,7 @@ export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
412
425
  readonly enablePasswordReset = false;
413
426
  private factor2Url;
414
427
  private loginUrl;
428
+ private logoutUrl;
415
429
  /**
416
430
  * Use these to access the `load` and `action` endpoints for functions
417
431
  * provided by Crossauth. These are the ones intended for users to
@@ -290,8 +290,10 @@ export type UpdateUserReturn = {
290
290
  */
291
291
  export declare class SvelteKitUserEndpoints {
292
292
  private sessionServer;
293
- private changePasswordUrl;
294
- private changeFactor2Url;
293
+ readonly changePasswordUrl: string | undefined;
294
+ readonly changeFactor2Url: string | undefined;
295
+ readonly configureFactor2Url: string | undefined;
296
+ readonly requestPasswordResetUrl: string | undefined;
295
297
  private loginRedirectUrl;
296
298
  private loginUrl;
297
299
  private addToSession?;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossauth/sveltekit",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "license": "Apache-2.0",
5
5
  "private": false,
6
6
  "type": "module",
@@ -46,8 +46,8 @@
46
46
  "minimatch": "^10.0.1",
47
47
  "qrcode": "^1.5.4",
48
48
  "vite-plugin-dts": "^3.6.4",
49
- "@crossauth/backend": "^0.0.37",
50
- "@crossauth/common": "^0.0.37"
49
+ "@crossauth/backend": "^0.0.39",
50
+ "@crossauth/common": "^0.0.39"
51
51
  },
52
52
  "scripts": {
53
53
  "preparex": "svelte-kit sync",