AuthConfig class
Configuration options for the Auth module.
Constructors
- AuthConfig({int maxAllowedEmailSignInAttempts = 5, Duration emailSignInFailureResetTime = const Duration(minutes: 5), bool enableUserImages = true, bool importUserImagesFromGoogleSignIn = true, int userImageSize = 256, UserImageType userImageFormat = UserImageType.jpg, int userImageQuality = 70, UserImageGenerator userImageGenerator = defaultUserImageGenerator, bool userCanEditUserImage = true, bool userCanEditUserName = true, bool userCanEditFullName = false, bool userCanSeeUserName = true, bool userCanSeeFullName = true, Duration userInfoCacheLifetime = const Duration(minutes: 1), UserInfoCreationCallback? onUserWillBeCreated, UserInfoUpdateCallback? onUserCreated, UserInfoUpdateCallback? onUserUpdated, SendPasswordResetEmailCallback? sendPasswordResetEmail, SendValidationEmailCallback? sendValidationEmail, Duration passwordResetExpirationTime = const Duration(hours: 24), bool extraSaltyHash = true, String firebaseServiceAccountKeyJson = 'config/firebase_service_account_key.json', int maxPasswordLength = 128, int minPasswordLength = 8, bool allowUnsecureRandom = true})
-
Creates a new Auth configuration. Use the set method to replace the
default settings. Defaults to
config/firebase_service_account_key.json
.
Properties
- allowUnsecureRandom → bool
-
True if unsecure random number generation is allowed. If set to false, an
error will be thrown if the platform does not support secure random number
generation. Default is true but will be changed to false in Serverpod 2.0.
final
- emailSignInFailureResetTime → Duration
-
The reset period for email sign in attempts. Defaults to 5 minutes.
final
- enableUserImages → bool
-
True if user images are enabled.
final
- extraSaltyHash → bool
-
True if the server should use the accounts email address as part of the
salt when storing password hashes (strongly recommended). Default is true.
final
- firebaseServiceAccountKeyJson → String
-
Firebase service account key JSON file. Generate and download from the
Firebase console.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- importUserImagesFromGoogleSignIn → bool
-
True if user images should be imported when signing in with Google.
final
- maxAllowedEmailSignInAttempts → int
-
Max allowed failed email sign in attempts within the reset period.
Defaults to 5. (By default, a user can make 5 sign in attempts within a
5 minute window.)
final
- maxPasswordLength → int
-
The maximum length of passwords when signing up with email.
Default is 128 characters.
final
- minPasswordLength → int
-
The minimum length of passwords when signing up with email.
Default is 8 characters.
final
- onUserCreated → UserInfoUpdateCallback?
-
Called after a user has been created. Listen to this callback if you need
to do additional setup.
final
- onUserUpdated → UserInfoUpdateCallback?
-
Called whenever a user has been updated. This can be when the user name
is changed or if the user uploads a new profile picture.
final
- onUserWillBeCreated → UserInfoCreationCallback?
-
Called when a user is about to be created, gives a chance to abort the
creation by returning false.
final
- passwordResetExpirationTime → Duration
-
The time for password resets to be valid. Default is one day.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendPasswordResetEmail → SendPasswordResetEmailCallback?
-
Called when a user should be sent a reset code by email.
final
- sendValidationEmail → SendValidationEmailCallback?
-
Called when a user should be sent a validation code on account setup.
final
- userCanEditFullName → bool
-
True if users can edit their full name.
final
- userCanEditUserImage → bool
-
True if users can update their profile images.
final
- userCanEditUserName → bool
-
True if users can edit their user names.
final
- userCanSeeFullName → bool
-
True if users can view their full name.
final
- userCanSeeUserName → bool
-
True if users can view their user name.
final
- userImageFormat → UserImageType
-
The format used to store user images. Defaults to JPG images.
final
- userImageGenerator → UserImageGenerator
-
Generator used to produce default user images. By default a generator that
mimics Google's default avatars is used.
final
- userImageQuality → int
-
The quality setting for images if JPG format is used.
final
- userImageSize → int
-
The size of user images. Defaults to 256.
final
- userInfoCacheLifetime → Duration
-
The duration which user infos are cached locally in the server. Default
is 1 minute.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- current → AuthConfig
-
Gets the current Auth module configuration.
no setter
Static Methods
-
set(
AuthConfig config) → void - Updates the configuration used by the Auth module.