Try to make esi use db.go
This commit is contained in:
8
main.go
8
main.go
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user