mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-09 20:32:55 +08:00
fix: rename to countryCodes
This commit is contained in:
@@ -39,11 +39,11 @@ func (application *Application) GetProviderByCategory(category string) (*Provide
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isProviderItemCountryCodeMatched(providerItem *ProviderItem, countryCode string) bool {
|
func isProviderItemCountryCodeMatched(providerItem *ProviderItem, countryCode string) bool {
|
||||||
if len(providerItem.CountryCode) == 0 {
|
if len(providerItem.CountryCodes) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, countryCode2 := range providerItem.CountryCode {
|
for _, countryCode2 := range providerItem.CountryCodes {
|
||||||
if countryCode2 == "" || countryCode2 == "All" || countryCode2 == "all" || countryCode2 == countryCode {
|
if countryCode2 == "" || countryCode2 == "All" || countryCode2 == "all" || countryCode2 == countryCode {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@@ -18,14 +18,14 @@ type ProviderItem struct {
|
|||||||
Owner string `json:"owner"`
|
Owner string `json:"owner"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
CanSignUp bool `json:"canSignUp"`
|
CanSignUp bool `json:"canSignUp"`
|
||||||
CanSignIn bool `json:"canSignIn"`
|
CanSignIn bool `json:"canSignIn"`
|
||||||
CanUnlink bool `json:"canUnlink"`
|
CanUnlink bool `json:"canUnlink"`
|
||||||
CountryCode []string `json:"countryCode"`
|
CountryCodes []string `json:"countryCode"`
|
||||||
Prompted bool `json:"prompted"`
|
Prompted bool `json:"prompted"`
|
||||||
SignupGroup string `json:"signupGroup"`
|
SignupGroup string `json:"signupGroup"`
|
||||||
Rule string `json:"rule"`
|
Rule string `json:"rule"`
|
||||||
Provider *Provider `json:"provider"`
|
Provider *Provider `json:"provider"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (application *Application) GetProviderItem(providerName string) *ProviderItem {
|
func (application *Application) GetProviderItem(providerName string) *ProviderItem {
|
||||||
|
Reference in New Issue
Block a user