MCPcopy
hub / github.com/pocketbase/pocketbase / initPasswordField

Method initPasswordField

core/collection_model.go:979–996  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

977}
978
979func (c *Collection) initPasswordField() {
980 field, _ := c.Fields.GetByName(FieldNamePassword).(*PasswordField)
981 if field == nil {
982 // load default field
983 c.Fields.Add(&PasswordField{
984 Name: FieldNamePassword,
985 System: true,
986 Hidden: true,
987 Required: true,
988 Min: 8,
989 })
990 } else {
991 // enforce system defaults
992 field.System = true
993 field.Hidden = true
994 field.Required = true
995 }
996}
997
998func (c *Collection) initTokenKeyField() {
999 field, _ := c.Fields.GetByName(FieldNameTokenKey).(*TextField)

Callers 1

initDefaultFieldsMethod · 0.95

Calls 2

GetByNameMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected