diff --git a/services/auth/source/oauth2/providers.go b/services/auth/source/oauth2/providers.go
index 7572aa20c0..e3a0cb0335 100644
--- a/services/auth/source/oauth2/providers.go
+++ b/services/auth/source/oauth2/providers.go
@@ -22,7 +22,7 @@ import (
type Provider interface {
Name() string
DisplayName() string
- IconHTML() template.HTML
+ IconHTML(size int) template.HTML
CustomURLSettings() *CustomURLSettings
}
@@ -54,14 +54,16 @@ func (p *AuthSourceProvider) DisplayName() string {
return p.sourceName
}
-func (p *AuthSourceProvider) IconHTML() template.HTML {
+func (p *AuthSourceProvider) IconHTML(size int) template.HTML {
if p.iconURL != "" {
- img := fmt.Sprintf(``,
+ img := fmt.Sprintf(``,
+ size,
+ size,
html.EscapeString(p.iconURL), html.EscapeString(p.DisplayName()),
)
return template.HTML(img)
}
- return p.GothProvider.IconHTML()
+ return p.GothProvider.IconHTML(size)
}
// Providers contains the map of registered OAuth2 providers in Gitea (based on goth)
diff --git a/services/auth/source/oauth2/providers_base.go b/services/auth/source/oauth2/providers_base.go
index 5ba06febaf..5b6694487b 100644
--- a/services/auth/source/oauth2/providers_base.go
+++ b/services/auth/source/oauth2/providers_base.go
@@ -27,7 +27,7 @@ func (b *BaseProvider) DisplayName() string {
}
// IconHTML returns icon HTML for this provider
-func (b *BaseProvider) IconHTML() template.HTML {
+func (b *BaseProvider) IconHTML(size int) template.HTML {
svgName := "gitea-" + b.name
switch b.name {
case "gplus":
@@ -35,10 +35,10 @@ func (b *BaseProvider) IconHTML() template.HTML {
case "github":
svgName = "octicon-mark-github"
}
- svgHTML := svg.RenderHTML(svgName, 20, "gt-mr-3")
+ svgHTML := svg.RenderHTML(svgName, size, "gt-mr-3")
if svgHTML == "" {
log.Error("No SVG icon for oauth2 provider %q", b.name)
- svgHTML = svg.RenderHTML("gitea-openid", 20, "gt-mr-3")
+ svgHTML = svg.RenderHTML("gitea-openid", size, "gt-mr-3")
}
return svgHTML
}
diff --git a/services/auth/source/oauth2/providers_openid.go b/services/auth/source/oauth2/providers_openid.go
index 54530ae8a8..a4dcfcafc7 100644
--- a/services/auth/source/oauth2/providers_openid.go
+++ b/services/auth/source/oauth2/providers_openid.go
@@ -28,8 +28,8 @@ func (o *OpenIDProvider) DisplayName() string {
}
// IconHTML returns icon HTML for this provider
-func (o *OpenIDProvider) IconHTML() template.HTML {
- return svg.RenderHTML("gitea-openid", 20, "gt-mr-3")
+func (o *OpenIDProvider) IconHTML(size int) template.HTML {
+ return svg.RenderHTML("gitea-openid", size, "gt-mr-3")
}
// CreateGothProvider creates a GothProvider from this Provider
diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl
index ec48524226..2b72f119cb 100644
--- a/templates/user/auth/signin_inner.tmpl
+++ b/templates/user/auth/signin_inner.tmpl
@@ -62,7 +62,7 @@
{{range $key := .OrderedOAuth2Names}}
{{$provider := index $.OAuth2Providers $key}}
- {{$provider.IconHTML}}
+ {{$provider.IconHTML 28}}
{{$.locale.Tr "sign_in_with_provider" $provider.DisplayName}}
{{end}}
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl
index 931efcf04b..e3dd337837 100644
--- a/templates/user/auth/signup_inner.tmpl
+++ b/templates/user/auth/signup_inner.tmpl
@@ -66,7 +66,7 @@
{{range $key := .OrderedOAuth2Names}}
{{$provider := index $.OAuth2Providers $key}}
- {{$provider.IconHTML}}
+ {{$provider.IconHTML 28}}
{{$.locale.Tr "sign_in_with_provider" $provider.DisplayName}}
{{end}}
diff --git a/templates/user/settings/security/accountlinks.tmpl b/templates/user/settings/security/accountlinks.tmpl
index f64277b5af..7fbd39cbd4 100644
--- a/templates/user/settings/security/accountlinks.tmpl
+++ b/templates/user/settings/security/accountlinks.tmpl
@@ -10,7 +10,7 @@
{{range $key := .OrderedOAuth2Names}}
{{$provider := index $.OAuth2Providers $key}}
- {{$provider.IconHTML}}
+ {{$provider.IconHTML 20}}
{{$provider.DisplayName}}
{{end}}