mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 04:35:40 +00:00
fix: split generic scopes string to array
This commit is contained in:
@@ -52,7 +52,7 @@ func (providers *Providers) Init() {
|
||||
ClientID: providers.Config.GenericClientId,
|
||||
ClientSecret: providers.Config.GenericClientSecret,
|
||||
RedirectURL: fmt.Sprintf("%s/api/oauth/callback/generic", providers.Config.AppURL),
|
||||
Scopes: []string{providers.Config.GenericScopes},
|
||||
Scopes: providers.Config.GenericScopes,
|
||||
Endpoint: oauth2.Endpoint{
|
||||
AuthURL: providers.Config.GenericAuthURL,
|
||||
TokenURL: providers.Config.GenericTokenURL,
|
||||
|
||||
@@ -63,7 +63,7 @@ type OAuthConfig struct {
|
||||
GoogleClientSecret string
|
||||
GenericClientId string
|
||||
GenericClientSecret string
|
||||
GenericScopes string
|
||||
GenericScopes []string
|
||||
GenericAuthURL string
|
||||
GenericTokenURL string
|
||||
GenericUserURL string
|
||||
|
||||
@@ -75,9 +75,9 @@ func ParseFileToLine(content string) string {
|
||||
return strings.Join(users, ",")
|
||||
}
|
||||
|
||||
func ParseWhitelist(whitelist string) []string {
|
||||
if whitelist == "" {
|
||||
func ParseCommaString(str string) []string {
|
||||
if str == "" {
|
||||
return []string{}
|
||||
}
|
||||
return strings.Split(whitelist, ",")
|
||||
return strings.Split(str, ",")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user