Try to make esi use db.go

This commit is contained in:
2025-10-10 20:00:33 +02:00
parent bae3254df8
commit 693c822c12
3 changed files with 50 additions and 29 deletions

View File

@@ -17,6 +17,7 @@ type Options struct {
ClientID string
RedirectURI string
Scopes []string
DBPath string
}
var options Options
@@ -32,7 +33,7 @@ func main() {
logger.Error("Failed to load options %v", err)
return
}
// Create SSO instance
sso, err := NewSSO(
options.ClientID,
@@ -75,10 +76,15 @@ func LoadOptions() (Options, error) {
return Options{}, fmt.Errorf("ESI_SCOPES is required in .env file")
}
scopes := strings.Fields(rawScopes)
dbPath := os.Getenv("DB_PATH")
if dbPath == "" {
return Options{}, fmt.Errorf("DB_PATH is required in .env file")
}
return Options{
ClientID: clientID,
RedirectURI: redirectURI,
Scopes: scopes,
DBPath: dbPath,
}, nil
}