@crossauth/fastify 0.0.36 → 0.0.38

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.
@@ -44,7 +44,7 @@ export interface FastifySessionServerOptions extends SessionManagerOptions, OAut
44
44
  */
45
45
  createUserFn?: (request: FastifyRequest<{
46
46
  Body: SignupBodyType;
47
- }>, userEditableFields: string[]) => UserInputFields;
47
+ }>, userEditableFields: string[], allowableFactor1: string[]) => UserInputFields;
48
48
  /** Function that updates a user from form fields.
49
49
  * Default one takes fields that begin with `user_`, removing the `user_`
50
50
  * prefix and filtering out anything not in the userEditableFields list in
@@ -233,6 +233,16 @@ export interface FastifySessionServerOptions extends SessionManagerOptions, OAut
233
233
  * @returns array of matching clients
234
234
  */
235
235
  clientSearchFn?: (searchTerm: string, clientStorage: OAuthClientStorage, userid?: string | number | null) => Promise<OAuthClient[]>;
236
+ /**
237
+ * When signing up themselves, users may choose any of these.
238
+ * Default: ["localpassword"]
239
+ */
240
+ userAllowedFactor1?: string[];
241
+ /**
242
+ * When admins create a user, they may choose any of these.
243
+ * Default: ["localpassword"]
244
+ */
245
+ adminAllowedFactor1?: string[];
236
246
  }
237
247
  /**
238
248
  * When not overriding which endpoints to enable, all of these will be.
@@ -542,7 +552,7 @@ export declare class FastifySessionServer implements FastifySessionAdapter {
542
552
  */
543
553
  createUserFn: (request: FastifyRequest<{
544
554
  Body: SignupBodyType;
545
- }>, userEditableFields: string[]) => UserInputFields;
555
+ }>, userEditableFields: string[], allowableFactor1: string[]) => UserInputFields;
546
556
  /**
547
557
  * Funtion to update a user record from form fields. Taken from the options during
548
558
  * construction or the default value.
@@ -591,6 +601,8 @@ export declare class FastifySessionServer implements FastifySessionAdapter {
591
601
  private factor2ProtectedApiEndpoints;
592
602
  private editUserScope?;
593
603
  readonly enableCsrfProtection = true;
604
+ readonly userAllowedFactor1: string[];
605
+ readonly adminAllowedFactor1: string[];
594
606
  /**
595
607
  * Constructor
596
608
  *