feat:#65 source code adjusted due to dep changes

This commit is contained in:
Elmar Kresse
2025-04-20 14:13:14 +02:00
parent 629a376176
commit c695eb6a1e
5 changed files with 82 additions and 23 deletions

View File

@@ -0,0 +1,44 @@
package migrations
import (
"encoding/json"
"github.com/pocketbase/pocketbase/core"
m "github.com/pocketbase/pocketbase/migrations"
)
func init() {
m.Register(func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("_pb_users_auth_")
if err != nil {
return err
}
// update collection data
if err := json.Unmarshal([]byte(`{
"oauth2": {
"enabled": true
}
}`), &collection); err != nil {
return err
}
return app.Save(collection)
}, func(app core.App) error {
collection, err := app.FindCollectionByNameOrId("_pb_users_auth_")
if err != nil {
return err
}
// update collection data
if err := json.Unmarshal([]byte(`{
"oauth2": {
"enabled": false
}
}`), &collection); err != nil {
return err
}
return app.Save(collection)
})
}