only allow user registrations from oauth, not user/password #103

This commit is contained in:
seriousm4x
2023-07-01 17:48:33 +02:00
parent a31f704274
commit 319817983e

View File

@@ -0,0 +1,34 @@
package migrations
import (
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
m "github.com/pocketbase/pocketbase/migrations"
"github.com/pocketbase/pocketbase/tools/types"
)
func init() {
m.Register(func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
if err != nil {
return err
}
collection.CreateRule = types.Pointer("@request.data.password:isset = false")
return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("27do0wbcuyfmbmx")
if err != nil {
return err
}
collection.CreateRule = nil
return dao.SaveCollection(collection)
})
}