static/jsvm/classes/PasswordField.html
PasswordField defines "password" type field for storing bcrypt hashed strings (usually used only internally for the "password" auth collection system field).
If you want to set a direct bcrypt hash as record field value you can use the SetRaw method, for example:
// generates a bcrypt hash of "123456" and set it as field value // (record.GetString("password") returns the plain password until persisted, otherwise empty string) record.Set("password", "123456") // set directly a bcrypt hash of "123456" as field value // (record.GetString("password") returns empty string) record.SetRaw("password", "$2a$10$.5Elh8fgxypNUWhpUUr/xOa2sZm0VIaE0qWuGGl9otUfobb46T1Pq")Copy
The following additional getter keys are available:
- "fieldName:hash" - returns the bcrypt hash string of the record field value (if any). For example: record.GetString("password:hash")Copy
columnTypedriverValuefindGetterfindSettergetHiddengetIdgetNamegetSysteminterceptprepareValuesetHiddensetIdsetNamesetSystemtypevalidateSettingsvalidateValue
costhiddenidmaxminnamepatternpresentablerequiredsystem
Optional data: Partial<core.PasswordField>ColumnType implements [Field.ColumnType] interface method.
DriverValue implements the [DriverValuer] interface.
FindGetter implements the [GetterFinder] interface.
FindSetter implements the [SetterFinder] interface.
GetHidden implements [Field.GetHidden] interface method.
GetId implements [Field.GetId] interface method.
GetName implements [Field.GetName] interface method.
GetSystem implements [Field.GetSystem] interface method.
Intercept implements the [RecordInterceptor] interface.
-
- (): void
-
PrepareValue implements [Field.PrepareValue] interface method.
SetHidden implements [Field.SetHidden] interface method.
SetId implements [Field.SetId] interface method.
SetName implements [Field.SetName] interface method.
SetSystem implements [Field.SetSystem] interface method.
Type implements [Field.Type] interface method.
ValidateSettings implements [Field.ValidateSettings] interface method.
ValidateValue implements [Field.ValidateValue] interface method.
cost: number
Cost specifies the cost/weight/iteration/etc. bcrypt factor.
If zero, fallback to [bcrypt.DefaultCost].
If explicitly set, must be between [bcrypt.MinCost] and [bcrypt.MaxCost].
hidden: boolean
Hidden hides the field from the API response.
id: string
Id is the unique stable field identifier.
It is automatically generated from the name when adding to a collection FieldsList.
max: number
Max specifies an optional required field string length.
If zero, fallback to max 71 bytes.
min: number
Min specifies an optional required field string length.
name: string
Name (required) is the unique name of the field.
pattern: string
Pattern specifies an optional regex pattern to match against the field value.
Leave it empty to skip the pattern check.
presentable: boolean
Presentable hints the Dashboard UI to use the underlying field record value in the relation preview label.
required: boolean
Required will require the field value to be non-empty string.
system: boolean
System prevents the renaming and removal of the field.
OSLightDark
Generated using TypeDoc