Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb81e1e4

Browse files
committed
Add auth config struct and restructure social auth provider config to enable iteration and adding other providers
1 parent3d7011e commitb81e1e4

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

‎config.default.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ login = true
4646
# Enable username/password registration
4747
registration =true
4848

49-
[auth.github]
49+
[auth.providers.github]
5050
key =""
5151
secret =""
5252

53-
[auth.facebook]
53+
[auth.providers.facebook]
5454
key =""
5555
secret =""
5656

57-
[auth.google]
57+
[auth.providers.google]
5858
key =""
5959
secret =""
6060

61-
[auth.twitter]
61+
[auth.providers.twitter]
6262
key =""
6363
secret =""
6464

‎config/config.go‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package config
33
import (
44
"time"
55

6-
"github.com/khlieng/dispatch/storage"
76
"github.com/fsnotify/fsnotify"
7+
"github.com/khlieng/dispatch/storage"
88
"github.com/spf13/viper"
99
)
1010

@@ -18,6 +18,7 @@ type Config struct {
1818
DefaultsDefaults
1919
HTTPSHTTPS
2020
LetsEncryptLetsEncrypt
21+
AuthAuth
2122
}
2223

2324
typeDefaultsstruct {
@@ -51,6 +52,18 @@ type LetsEncrypt struct {
5152
Emailstring
5253
}
5354

55+
typeAuthstruct {
56+
Anonymousbool
57+
Loginbool
58+
Registrationbool
59+
Providersmap[string]Provider
60+
}
61+
62+
typeProviderstruct {
63+
Keystring
64+
Secretstring
65+
}
66+
5467
funcLoadConfig() (*Config,chan*Config) {
5568
viper.SetConfigName("config")
5669
viper.AddConfigPath(storage.Path.ConfigRoot())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp