@crossauth/sveltekit 0.0.14 → 0.0.16

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.
@@ -8,7 +8,7 @@ import { SvelteKitAdminClientEndpoints } from './sveltekitadminclientendpoints';
8
8
  import { SvelteKitSessionAdapter } from './sveltekitsessionadapter';
9
9
 
10
10
  export declare const CSRFHEADER = "X-CROSSAUTH-CSRF";
11
- type Header = {
11
+ export type Header = {
12
12
  name: string;
13
13
  value: string;
14
14
  };
@@ -256,7 +256,17 @@ export interface SvelteKitSessionServerOptions extends SessionManagerOptions {
256
256
  * The Sveltekit session server.
257
257
  *
258
258
  * You shouldn't have to instantiate this directly. It is created when
259
- * you create a {@link SveltekitServer} object.
259
+ * you create a {@link SvelteKitServer} object.
260
+
261
+ * **Middleware**
262
+ *
263
+ * This class registers one middleware function to fill in the following
264
+ * fields in the request:
265
+ *
266
+ * - `user` a {@link @crossauth/common!User}` object
267
+ * - `authType`: set to `cookie` or undefined
268
+ * - `csrfToken`: a CSRF token that can be used in POST requests
269
+ * - `sessionId` a session ID if one is created
260
270
  */
261
271
  export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
262
272
  /**
@@ -298,13 +308,13 @@ export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
298
308
  /**
299
309
  * Funtion to validate users upon creation. Taken from the options during
300
310
  * construction or the default value.
301
- * See {@link FastifySessionServerOptions}.
311
+ * See {@link SvelteKitSessionServerOptions}.
302
312
  */
303
313
  validateUserFn: (user: UserInputFields) => string[];
304
314
  /**
305
315
  * Funtion to create a user record from form fields. Taken from the options during
306
316
  * construction or the default value.
307
- * See {@link FastifySessionServerOptions}.
317
+ * See {@link SvelteKitSessionServerOptions}.
308
318
  */
309
319
  createUserFn: (event: RequestEvent, data: {
310
320
  [key: string]: string | undefined;
@@ -312,14 +322,14 @@ export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
312
322
  /**
313
323
  * Funtion to update a user record from form fields. Taken from the options during
314
324
  * construction or the default value.
315
- * See {@link FastifySessionServerOptions}.
325
+ * See {@link SvelteKitSessionServerOptions}.
316
326
  */
317
327
  updateUserFn: (user: User, event: RequestEvent, data: {
318
328
  [key: string]: string | undefined;
319
329
  }, userEditableFields: string[]) => User;
320
330
  /**
321
331
  * The set of authenticators taken from constructor args.
322
- * See {@link FastifySessionServer.constructor}.
332
+ * See {@link SvelteKitSessionServer.constructor}.
323
333
  */
324
334
  readonly authenticators: {
325
335
  [key: string]: Authenticator;
@@ -445,7 +455,7 @@ export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
445
455
  /**
446
456
  * Sets headers in the request event.
447
457
  *
448
- * Used internally by {@link SveltekitServer}. Shouldn't be necessary
458
+ * Used internally by {@link SvelteKitServer}. Shouldn't be necessary
449
459
  * to call this directly.
450
460
  * @param headers the headres to set
451
461
  * @param resp the response object to set them in
@@ -508,7 +518,7 @@ export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
508
518
  /**
509
519
  * Returns a hash of the session ID. Used for logging (for security,
510
520
  * the actual session ID is not logged)
511
- * @param request the Fastify request
521
+ * @param event the Sveltekit request event
512
522
  * @returns hash of the session ID
513
523
  */
514
524
  getHashOfSessionId(event: RequestEvent): string;
@@ -588,8 +598,7 @@ export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
588
598
  * with a user (`userid` is undefined). It can be used to persist
589
599
  * data between sessions just like a regular user session ID.
590
600
  *
591
- * @param request the Fastify request
592
- * @param reply the Fastify reply
601
+ * @param event the SvelteKit reqzest event
593
602
  * @param data session data to save
594
603
  * @returns the session cookie value
595
604
  */
@@ -643,4 +652,3 @@ export declare class SvelteKitSessionServer implements SvelteKitSessionAdapter {
643
652
  */
644
653
  deleteSessionData(event: RequestEvent, name: string): Promise<void>;
645
654
  }
646
- export {};
@@ -20,7 +20,7 @@ export declare abstract class SvelteKitSessionAdapter {
20
20
  *
21
21
  * The `data` field is assumed to be JSON. Just the field with the given
22
22
  * name is updated and the rest is unchanged.
23
- * @param request the Fastifdy request
23
+ * @param event the SvelteKit request event
24
24
  * @param dataArray data to update
25
25
  */
26
26
  abstract updateManySessionData(event: RequestEvent, dataArray: {
@@ -4,8 +4,8 @@ import { OAuthClient } from '@crossauth/common';
4
4
  import { RequestEvent } from '@sveltejs/kit';
5
5
 
6
6
  /**
7
- * Return type for {@link SvelteKitUserClientEndpoints.searchClient}
8
- * {@link SvelteKitAdminClientEndpoints.searchClient} load.
7
+ * Return type for {@link SvelteKitUserClientEndpoints.searchClients}
8
+ * {@link SvelteKitAdminClientEndpoints.searchClients} load.
9
9
  *
10
10
  * See class documentation for {@link SvelteKitSharedClientEndpoints} for more details.
11
11
  */
@@ -43,7 +43,7 @@ export type UpdateClientPageData = {
43
43
  };
44
44
  /**
45
45
  * Return type for {@link SvelteKitUserClientEndpoints.updateClientEndpoint}
46
- * {@link SvelteKitAdminClientEndpoints.updateClienEndpoint} actions.
46
+ * {@link SvelteKitAdminClientEndpoints.updateClientEndpoint} actions.
47
47
  *
48
48
  * See class documentation for {@link SvelteKitSharedClientEndpoints} for more details.
49
49
  */
@@ -59,7 +59,7 @@ export type UpdateClientFormData = {
59
59
  plaintextSecret?: string;
60
60
  };
61
61
  /**
62
- * Return type for {@link SvelteKitUserClientEndpoints.createClientEndpoints}
62
+ * Return type for {@link SvelteKitUserClientEndpoints.createClientEndpoint}
63
63
  * {@link SvelteKitAdminClientEndpoints.createClient} load.
64
64
  *
65
65
  * See class documentation for {@link SvelteKitSharedClientEndpoints} for more details.
@@ -205,7 +205,7 @@ export declare class SvelteKitSharedClientEndpoints {
205
205
  * or the empty string.
206
206
  * - `skip` the number to start returning from. 0 if not defined
207
207
  * - `take` the maximum number to return. 10 if not defined.
208
- * @param search overrides the search term from the query.
208
+ * @param searchTerm overrides the search term from the query.
209
209
  * @param skip overrides the skip term from the query
210
210
  * @param take overrides the take term from the query
211
211
  *
@@ -229,7 +229,7 @@ export declare class SvelteKitSharedClientEndpoints {
229
229
  *
230
230
  * @param event the Sveltekit request event. The following are taken:
231
231
  * - `client_id` from the URL path parameters
232
- * @returns {@see UpdateClientPageData}
232
+ * @returns {@link UpdateClientPageData}
233
233
  */
234
234
  protected loadClient_internal(event: RequestEvent): Promise<UpdateClientPageData>;
235
235
  /**
@@ -241,8 +241,8 @@ export declare class SvelteKitSharedClientEndpoints {
241
241
  * - `redirect_uri` from the body form data (space-separated)
242
242
  * - `confidential` from the body form data: 1, `on`, `yes` or `true` are true
243
243
  * _ `resetSecret` if true (1, `on`, `yes` or `true`), create and return a new secret. Ignored if not confidential
244
- * - Flow names from {@link @crossauth/common/OAuthFlows} taken from the body form data. 1, `on`, `yes` or `true` are true
245
- * @returns {@see UpdateClientFormData}. If a new secret was created, it will be placed as plaintext in the client that is returned.
244
+ * - Flow names from {@link @crossauth/common!OAuthFlows} taken from the body form data. 1, `on`, `yes` or `true` are true
245
+ * @returns {@link UpdateClientFormData}. If a new secret was created, it will be placed as plaintext in the client that is returned.
246
246
  */
247
247
  protected updateClient_internal(event: RequestEvent, isAdmin: boolean): Promise<UpdateClientFormData>;
248
248
  /**
@@ -251,7 +251,7 @@ export declare class SvelteKitSharedClientEndpoints {
251
251
  * @param event the Sveltekit request event. The following are taken:
252
252
  * - `userid` from the body parameters parameters. Ignored if `isAdmin` is false. Can be undefined
253
253
  * -
254
- * @returns {@see CreateClientPageData}.
254
+ * @returns {@link CreateClientPageData}.
255
255
  */
256
256
  protected emptyClient_internal(event: RequestEvent, isAdmin: boolean): Promise<CreateClientPageData>;
257
257
  /**
@@ -262,8 +262,8 @@ export declare class SvelteKitSharedClientEndpoints {
262
262
  * - `client_name` from the body form data
263
263
  * - `redirect_uri` from the body form data (space-separated)
264
264
  * - `confidential` from the body form data: 1, `on`, `yes` or `true` are true
265
- * - Flow names from {@link @crossauth/common/OAuthFlows} taken from the body form data. 1, `on`, `yes` or `true` are true
266
- * @returns {@see UpdateClientFormData}. If a secret was created, it will be placed as plaintext in the client that is returned. A random `client_id` is created.
265
+ * - Flow names from {@link @crossauth/common!OAuthFlows} taken from the body form data. 1, `on`, `yes` or `true` are true
266
+ * @returns {@link UpdateClientFormData}. If a secret was created, it will be placed as plaintext in the client that is returned. A random `client_id` is created.
267
267
  */
268
268
  protected createClient_internal(event: RequestEvent, isAdmin: boolean): Promise<CreateClientFormData>;
269
269
  /**
@@ -271,7 +271,7 @@ export declare class SvelteKitSharedClientEndpoints {
271
271
  *
272
272
  * @param event the Sveltekit request event. The following are taken:
273
273
  * - `client_id` from the URL path parameters
274
- * @returns {@see DeleteClientPageData}
274
+ * @returns {@link DeleteClientPageData}
275
275
  */
276
276
  protected loadDeleteClient_internal(event: RequestEvent): Promise<DeleteClientPageData>;
277
277
  /**
@@ -279,7 +279,7 @@ export declare class SvelteKitSharedClientEndpoints {
279
279
  *
280
280
  * @param event the Sveltekit request event. The following are taken:
281
281
  * - `client_id` from the URL path parameters
282
- * @returns {@see DeleteClientFormData}
282
+ * @returns {@link DeleteClientFormData}
283
283
  */
284
284
  protected deleteClient_internal(event: RequestEvent, isAdmin: boolean): Promise<DeleteClientFormData>;
285
285
  /**
@@ -11,7 +11,7 @@ import { SearchClientsPageData, UpdateClientPageData, UpdateClientFormData, Dele
11
11
  * **Endpoints**
12
12
  *
13
13
  * These endpoints can only be called if an admin user is logged in, as defined
14
- * by the {@link SveltekitSessionServer.isAdminFn}. If the user does not
14
+ * by the {@link SvelteKitServer.isAdminFn}. If the user does not
15
15
  * have this permission, a 401 error is raised.
16
16
  *
17
17
  * | Name | Description | PageData (returned by load) | ActionData (return by actions) | Form fields expected by actions | URL param |
@@ -21,14 +21,14 @@ import { SearchClientsPageData, UpdateClientPageData, UpdateClientFormData, Dele
21
21
  * | -------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | --------- |
22
22
  * | searchClientsEndpoint | Returns a paginated set of clients or those matching search | See {@link SearchClientsPageData} | *Not provided* | | |
23
23
  * | -------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | --------- |
24
- * | updateClientEndpoint | Updates a client | See {@link UpdateClientsPageData} | `default`: | | |
25
- * | | | | See {@link UpdateClientsFormData} | See {@link SvelteKitSharedClientEndpoints.updateClient_internal} | client_id |
24
+ * | updateClientEndpoint | Updates a client | See {@link UpdateClientPageData} | `default`: | | |
25
+ * | | | | See {@link UpdateClientFormData} | See {@link SvelteKitSharedClientEndpoints.updateClient_internal} | client_id |
26
26
  * | -------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | --------- |
27
- * | createClientEndpoint | Creates a new client | See {@link CreateClientsPageData} | `default`: | | |
28
- * | | | | See {@link CreateClientsFormData} | See {@link SvelteKitSharedClientEndpoints.createClient_internal} | client_id |
27
+ * | createClientEndpoint | Creates a new client | See {@link CreateClientPageData} | `default`: | | |
28
+ * | | | | See {@link CreateClientFormData} | See {@link SvelteKitSharedClientEndpoints.createClient_internal} | client_id |
29
29
  * | -------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | --------- |
30
- * | deleteClientEndpoint | Deletes a client | See {@link DeleteClientsPageData} | `default`: | | |
31
- * | | | | See {@link DeleteClientsFormData} | See {@link SvelteKitSharedClientEndpoints.deleteClient_internal} | client_id |
30
+ * | deleteClientEndpoint | Deletes a client | See {@link DeleteClientPageData} | `default`: | | |
31
+ * | | | | See {@link DeleteClientFormData} | See {@link SvelteKitSharedClientEndpoints.deleteClient_internal} | client_id |
32
32
  * | -------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | --------- |
33
33
  */
34
34
  export declare class SvelteKitUserClientEndpoints extends SvelteKitSharedClientEndpoints {
@@ -34,7 +34,7 @@ export type LogoutReturn = {
34
34
  errorCodeName?: string;
35
35
  };
36
36
  /**
37
- * Return type for {@link SvelteKitUserEndpoints.signuput}
37
+ * Return type for {@link SvelteKitUserEndpoints.signup}
38
38
  * {@link SvelteKitUserEndpoints.signupEndpoint} action.
39
39
  *
40
40
  * See class documentation for {@link SvelteKitUserEndpoints} for more details.
@@ -86,7 +86,7 @@ export type ConfigureFactor2Return = {
86
86
  };
87
87
  /**
88
88
  * Return type for {@link SvelteKitUserEndpoints.verifyEmail}
89
- * {@link SvelteKitUserEndpoints.verifyEmailEndpoint} action.
89
+ * {@link SvelteKitUserEndpoints.verifyEmailTokenEndpoint} action.
90
90
  *
91
91
  * See class documentation for {@link SvelteKitUserEndpoints} for more details.
92
92
  */
@@ -219,8 +219,8 @@ export type UpdateUserReturn = {
219
219
  * Provides endpoints for users to login, logout and maintain their
220
220
  * own account.
221
221
  *
222
- * This is created automatically when {@link SveltekitServer} is instantiated.
223
- * The endpoints are available through `SveltekitServer.sessionServer.userEndpoints`.
222
+ * This is created automatically when {@link SvelteKitServer} is instantiated.
223
+ * The endpoints are available through `SvelteKitServer.sessionServer.userEndpoints`.
224
224
  *
225
225
  * The methods in this class are designed to be used in
226
226
  * `+*_server.ts` files in the `load` and `actions` exports. You can
@@ -234,7 +234,7 @@ export type UpdateUserReturn = {
234
234
  * ```
235
235
  * The `?? crossauth.dummyLoad` and `?? crossauth.dummyActions` is to stop
236
236
  * typescript complaining as the `sessionServer` member of the
237
- * {@link @crossauth/sveltekit/SveltekitServer} object may be undefined, because
237
+ * {@link SvelteKitServer} object may be undefined, because
238
238
  * some application do not have a session server.
239
239
  *
240
240
  * **Endpoints**
@@ -245,43 +245,43 @@ export type UpdateUserReturn = {
245
245
  * | | | - `csrfToken` CSRF token if enabled | | | | | loginPage |
246
246
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
247
247
  * | signupEndpoint | Create a user and sign in | - `allowedFactor2` array of: | `default`: | `default`: | |
248
- * | | | - `name` name that is in user's `factor2` | - see {@link SveltekitEndpoint.signup} return | - see {@link SveltekitUserEndpoint.signup} event | |
248
+ * | | | - `name` name that is in user's `factor2` | - see {@link SvelteKitUserEndpoints.signup} return | - see {@link SvelteKitUserEndpoints.signup} event | |
249
249
  * | | | - `friendlyName` for showing in form | | | |
250
250
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
251
251
  * | loginEndpoint | Logs a user in | - `next` page to redirect to on ok | `login`: starts login | `login`: | |
252
- * | | | | - see {@link SveltekitEndpoint.login} return | - see {@link SveltekitUserEndpoint.login} event | |
252
+ * | | | | - see {@link SvelteKitUserEndpoints.login} return | - see {@link SvelteKitUserEndpoints.login} event | |
253
253
  * | | | | `factor2`: submit 2FA data to complete login | `factor2`: | |
254
- * | | | | - see {@link SveltekitEndpoint.loginFactor2} return | - see {@link SveltekitUserEndpoint.loginFactor2} event | |
254
+ * | | | | - see {@link SvelteKitUserEndpoints.loginFactor2} return | - see {@link SvelteKitUserEndpoints.loginFactor2} event | |
255
255
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
256
256
  * | factor2Endpoint | Called when 2FA authentication is needed | See {@link SvelteKitUserEndpoints.requestFactor2} return | *Not provided* | | |
257
257
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
258
258
  * | logoutEndpoint | Logs a user out | Just `baseEndpoint` data | `default`: | `default`: | |
259
- * | | | | - see {@link SveltekitUserEndpoint.logout} return | - see {@link SveltekitUserEndpoint.logout} event | |
259
+ * | | | | - see {@link SvelteKitUserEndpoints.logout} return | - see {@link SvelteKitUserEndpoints.logout} event | |
260
260
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
261
261
  * | changeFactor2Endpoint | Change user's factor2 method or reconfigure existing | - `next` page to redirect to on ok | `change`: change to a different factor2 | `change`: | |
262
- * | | | - `required` if true, this was called because the user must | - see {@link SveltekitUserEndpoint.changeFactor2} return | - see {@link SveltekitUserEndpoint.changeFactor2} event | |
262
+ * | | | - `required` if true, this was called because the user must | - see {@link SvelteKitUserEndpoints.changeFactor2} return | - see {@link SvelteKitUserEndpoints.changeFactor2} event | |
263
263
  * | | | eg if user's `state` set to `factor2ResetRequired` | `factor2`: submit 2FA data to complete login | `factor2`: | |
264
- * | | | - `username` the user's username (`user` not set if not fully logged in yet) | - see {@link SveltekitUserEndpoint.loginFactor2} return | - see {@link SveltekitUserEndpoint.loginFactor2} event | |
264
+ * | | | - `username` the user's username (`user` not set if not fully logged in yet) | - see {@link SvelteKitUserEndpoints.loginFactor2} return | - see {@link SvelteKitUserEndpoints.loginFactor2} event | |
265
265
  * | | | - `allowedFactor2` see PageData for `signupEndpoint` | | | |
266
266
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
267
267
  * | changePasswordEndpoint | Change user's factor2 method or reconfigure existing | - `next` page to redirect to on ok | `default`: | `default`: | |
268
- * | | | - `required` if true, this was called because the user must | - see {@link SveltekitUserEndpoint.changePassword} return | - see {@link SveltekitUserEndpoint.changePassword} event | |
268
+ * | | | - `required` if true, this was called because the user must | - see {@link SvelteKitUserEndpoints.changePassword} return | - see {@link SvelteKitUserEndpoints.changePassword} event | |
269
269
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
270
270
  * | configureFactor2Endpoint | Configure secrets for user's factor2 | Just `baseEndpoint` data | `default`: | `default`: | |
271
- * | | | | - see {@link SveltekitUserEndpoint.configureFactor2} return | - see {@link SveltekitUserEndpoint.configureFactor2} event | |
271
+ * | | | | - see {@link SvelteKitUserEndpoints.configureFactor2} return | - see {@link SvelteKitUserEndpoints.configureFactor2} event | |
272
272
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
273
273
  * | deleteUserEndpoint | Delete the logged in user | Just `baseEndpoint` data | `default`: | `default`: | |
274
- * | | | | - see {@link SveltekitUserEndpoint.deleteUser} return | - see {@link SveltekitUserEndpoint.deleteUser} event | |
274
+ * | | | | - see {@link SvelteKitUserEndpoints.deleteUser} return | - see {@link SvelteKitUserEndpoints.deleteUser} event | |
275
275
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
276
276
  * | resetPasswordEndpoint | Requests and password reset and emails token to user | - `next` page to redirect to on ok | `default`: | `default`: | |
277
- * | | | - `required` if true, this was called because the user must | - see {@link SveltekitUserEndpoint.requestPasswordReset} return | - see {@link SveltekitUserEndpoint.requestPasswordReset} event | |
277
+ * | | | - `required` if true, this was called because the user must | - see {@link SvelteKitUserEndpoints.requestPasswordReset} return | - see {@link SvelteKitUserEndpoints.requestPasswordReset} event | |
278
278
  * | | | | | | |
279
279
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
280
280
  * | passwordResetTokenEndpoint | Validates emailed token and executes a password reset | - `tokenValidates` true if the token is valid | `default`: | `default`: | `token` |
281
- * | | | - `error` error message if token is not valid | - see {@link SveltekitUserEndpoint.resetPassword} return | - see {@link SveltekitUserEndpoint.resetPassword} event | |
281
+ * | | | - `error` error message if token is not valid | - see {@link SvelteKitUserEndpoints.resetPassword} return | - see {@link SvelteKitUserEndpoints.resetPassword} event | |
282
282
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
283
283
  * | updateUserEndpoint | Update currently-logged in user's details | - `allowedFactor2` see PageData for `signupEndpoint` | `default`: | `default`: | |
284
- * | | | - `required` if true, this was called because the user must | - see {@link SveltekitUserEndpoint.updateUser} return | - see {@link SveltekitUserEndpoint.updateUser} event | |
284
+ * | | | - `required` if true, this was called because the user must | - see {@link SvelteKitUserEndpoints.updateUser} return | - see {@link SvelteKitUserEndpoints.updateUser} event | |
285
285
  * | -------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------------- | --------- |
286
286
  * | verifyEmailTokenEndpoint | Validates an email verification token emailed to user | - `user` corresponding {@link @crossauth/common!User} if token is valid | *None provided* | | `token` |
287
287
  * | | | - `error` error message if token validation failed | | | |
@@ -302,7 +302,7 @@ export declare class SvelteKitUserEndpoints {
302
302
  * A user can edit his or her account if they are logged in with
303
303
  * session management, or are logged in with some other means and
304
304
  * e`ditUserScope` has been set and is included in the user's scopes.
305
- * @param request the Fastify request
305
+ * @param event the SvelteKit request event
306
306
  * @returns true or false
307
307
  */
308
308
  canEditUser(event: RequestEvent): boolean | "" | undefined;
@@ -379,7 +379,7 @@ export declare class SvelteKitUserEndpoints {
379
379
  * - `repeat_`*secrets* (eg `repeat_password`)
380
380
  * - `user_*` anything prefixed with `user` that is also in
381
381
  * - the `userEditableFields` option passed when constructing the
382
- * user storage object will be added to the {@link @crossuath/common!User}
382
+ * user storage object will be added to the {@link @crossauth/common!User}
383
383
  * object (with `user_` removed).
384
384
  *
385
385
  * @returns object with:
@@ -568,7 +568,7 @@ export declare class SvelteKitUserEndpoints {
568
568
  * - `username` the desired username
569
569
  * - `user_*` anything prefixed with `user` that is also in
570
570
  * the `userEditableFields` option passed when constructing the
571
- * user storage object will be added to the {@link @crossuath/common!User}
571
+ * user storage object will be added to the {@link @crossauth/common!User}
572
572
  * object (with `user_` removed).
573
573
  *
574
574
  * @returns object with:
@@ -1,4 +1,4 @@
1
- export declare function oauthLogin(): Promise<{
1
+ export declare function oauthLogin(options?: {}): Promise<{
2
2
  server: import('..').SvelteKitServer;
3
3
  authServer: import('@crossauth/backend').OAuthAuthorizationServer;
4
4
  sessionCookieValue: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossauth/sveltekit",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
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.14",
50
- "@crossauth/common": "^0.0.14"
49
+ "@crossauth/common": "^0.0.16",
50
+ "@crossauth/backend": "^0.0.16"
51
51
  },
52
52
  "scripts": {
53
53
  "dev": "vite dev",