mirror of
https://github.com/kevin-DL/wails-vue-template.git
synced 2026-01-22 22:25:21 +00:00
Added basic auth and route protection
This commit is contained in:
8
main.go
8
main.go
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
|
||||
"github.com/wailsapp/wails/v2"
|
||||
@@ -14,6 +15,7 @@ var assets embed.FS
|
||||
func main() {
|
||||
// Create an instance of the app structure
|
||||
app := NewApp()
|
||||
auth := NewAuth()
|
||||
|
||||
// Create application with options
|
||||
err := wails.Run(&options.App{
|
||||
@@ -24,9 +26,13 @@ func main() {
|
||||
Assets: assets,
|
||||
},
|
||||
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
|
||||
OnStartup: app.startup,
|
||||
OnStartup: func(ctx context.Context) {
|
||||
app.startup(ctx)
|
||||
auth.startup(ctx)
|
||||
},
|
||||
Bind: []interface{}{
|
||||
app,
|
||||
auth,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user