mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
move auth setup to onbeforeserve
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,6 +1,6 @@
|
|||||||
monitor-site
|
|
||||||
.idea.md
|
.idea.md
|
||||||
pb_data
|
pb_data
|
||||||
data
|
data
|
||||||
temp
|
temp
|
||||||
.vscode
|
.vscode
|
||||||
|
beszel
|
2
main.go
2
main.go
@@ -44,7 +44,7 @@ func main() {
|
|||||||
// })
|
// })
|
||||||
|
|
||||||
// set auth settings
|
// set auth settings
|
||||||
app.OnAfterBootstrap().Add(func(e *core.BootstrapEvent) error {
|
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
|
||||||
usersCollection, err := app.Dao().FindCollectionByNameOrId("users")
|
usersCollection, err := app.Dao().FindCollectionByNameOrId("users")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Reference in New Issue
Block a user