diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-01-02 21:12:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-02 21:12:35 +0800 |
commit | de8e3948a5e38f7eaf82d3c0cfd10e995bf68e92 (patch) | |
tree | bbcb011d264e0d614d49c734856b446360c5a4a3 /services/auth/source/pam/source.go | |
parent | e61b390d545919244141b699b28e3fbc42adc66f (diff) | |
download | gitea-de8e3948a5e38f7eaf82d3c0cfd10e995bf68e92.tar.gz gitea-de8e3948a5e38f7eaf82d3c0cfd10e995bf68e92.zip |
Refactor auth package (#17962)
Diffstat (limited to 'services/auth/source/pam/source.go')
-rw-r--r-- | services/auth/source/pam/source.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/services/auth/source/pam/source.go b/services/auth/source/pam/source.go index 65ae76138c..957c89dc85 100644 --- a/services/auth/source/pam/source.go +++ b/services/auth/source/pam/source.go @@ -5,7 +5,7 @@ package pam import ( - "code.gitea.io/gitea/models/login" + "code.gitea.io/gitea/models/auth" "code.gitea.io/gitea/modules/json" ) @@ -22,8 +22,8 @@ type Source struct { EmailDomain string SkipLocalTwoFA bool `json:",omitempty"` // Skip Local 2fa for users authenticated with this source - // reference to the loginSource - loginSource *login.Source + // reference to the authSource + authSource *auth.Source } // FromDB fills up a PAMConfig from serialized format. @@ -36,11 +36,11 @@ func (source *Source) ToDB() ([]byte, error) { return json.Marshal(source) } -// SetLoginSource sets the related LoginSource -func (source *Source) SetLoginSource(loginSource *login.Source) { - source.loginSource = loginSource +// SetAuthSource sets the related AuthSource +func (source *Source) SetAuthSource(authSource *auth.Source) { + source.authSource = authSource } func init() { - login.RegisterTypeConfig(login.PAM, &Source{}) + auth.RegisterTypeConfig(auth.PAM, &Source{}) } |