mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-17 12:02:26 +01:00
feat: Add new data-manager service for professor and module management and a new frontend application with i18n and a professor dashboard.
This commit is contained in:
32
services/data-manager/migrations/1745249436_enable_oauth2.go
Normal file
32
services/data-manager/migrations/1745249436_enable_oauth2.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("users")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Enable OAuth2
|
||||
collection.OAuth2.Enabled = true
|
||||
|
||||
// Optional: Map fields if necessary, for now just enabling it
|
||||
// collection.OAuth2.MappedFields.Name = "name"
|
||||
|
||||
return app.Save(collection)
|
||||
}, func(app core.App) error {
|
||||
collection, err := app.FindCollectionByNameOrId("users")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
collection.OAuth2.Enabled = false
|
||||
|
||||
return app.Save(collection)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user