mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Improve OAuth2 integration
This commit is contained in:
parent
cc6d272eb7
commit
747da03e4c
16 changed files with 120 additions and 15 deletions
|
@ -23,6 +23,10 @@ type googleProvider struct {
|
|||
redirectURL string
|
||||
}
|
||||
|
||||
func (g googleProvider) GetUserExtraKey() string {
|
||||
return "google_id"
|
||||
}
|
||||
|
||||
func (g googleProvider) GetRedirectURL(state string) string {
|
||||
return g.config().AuthCodeURL(state)
|
||||
}
|
||||
|
@ -48,7 +52,7 @@ func (g googleProvider) GetProfile(code string) (*Profile, error) {
|
|||
return nil, fmt.Errorf("unable to unserialize google profile: %v", err)
|
||||
}
|
||||
|
||||
profile := &Profile{Key: "google_id", ID: user.Sub, Username: user.Email}
|
||||
profile := &Profile{Key: g.GetUserExtraKey(), ID: user.Sub, Username: user.Email}
|
||||
return profile, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue