summaryrefslogtreecommitdiffstats
path: root/services/auth/source/oauth2/source_name.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/auth/source/oauth2/source_name.go')
-rw-r--r--services/auth/source/oauth2/source_name.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/services/auth/source/oauth2/source_name.go b/services/auth/source/oauth2/source_name.go
new file mode 100644
index 0000000..eee789e
--- /dev/null
+++ b/services/auth/source/oauth2/source_name.go
@@ -0,0 +1,18 @@
+// Copyright 2021 The Gitea Authors. All rights reserved.
+// SPDX-License-Identifier: MIT
+
+package oauth2
+
+// Name returns the provider name of this source
+func (source *Source) Name() string {
+ return source.Provider
+}
+
+// DisplayName returns the display name of this source
+func (source *Source) DisplayName() string {
+ provider, has := gothProviders[source.Provider]
+ if !has {
+ return source.Provider
+ }
+ return provider.DisplayName()
+}