Skip to content

Commit

Permalink
lower minimum user password length to 5, #112
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousm4x committed Jul 10, 2023
1 parent cda98f6 commit 06b7d3e
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions backend/migrations/1688998224_updated_users.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package migrations

import (
"encoding/json"

"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
m "github.com/pocketbase/pocketbase/migrations"
)

func init() {
m.Register(func(db dbx.Builder) error {
dao := daos.New(db);

collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
if err != nil {
return err
}

options := map[string]any{}
json.Unmarshal([]byte(`{
"allowEmailAuth": true,
"allowOAuth2Auth": true,
"allowUsernameAuth": true,
"exceptEmailDomains": [],
"manageRule": null,
"minPasswordLength": 5,
"onlyEmailDomains": [],
"requireEmail": false
}`), &options)
collection.SetOptions(options)

return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);

collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
if err != nil {
return err
}

options := map[string]any{}
json.Unmarshal([]byte(`{
"allowEmailAuth": true,
"allowOAuth2Auth": true,
"allowUsernameAuth": true,
"exceptEmailDomains": [],
"manageRule": null,
"minPasswordLength": 8,
"onlyEmailDomains": [],
"requireEmail": false
}`), &options)
collection.SetOptions(options)

return dao.SaveCollection(collection)
})
}

0 comments on commit 06b7d3e

Please sign in to comment.