Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
Signed-off-by: yxxhero <aiopsclub@163.com>
  • Loading branch information
yxxhero authored and gaius-qi committed Aug 31, 2021
1 parent 6083234 commit 8ddefea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions manager/oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Oauther interface {
GetRediectURL(*gorm.DB) (string, error)
GetOauthUserInfo(string) (*oauth2User, error)
ExchangeUserByCode(string, *gorm.DB) (*model.User, error)
AuthCodeURL(string) string
AuthCodeURL() string
}

func NewBaseOauth2(name string, clientID string, clientSecret string, scopes string, authURL string, tokenURL string, db *gorm.DB) (Oauther, error) {
Expand Down Expand Up @@ -67,8 +67,8 @@ func (oa *baseOauth2) GetRediectURL(db *gorm.DB) (string, error) {
return fmt.Sprintf("%s/api/v1/oauth/%s/sigin", s.Value, oa.Name), nil
}

func (oa *baseOauth2) AuthCodeURL(state string) string {
return oa.Config.AuthCodeURL(state)
func (oa *baseOauth2) AuthCodeURL() string {
return oa.Config.AuthCodeURL("state")
}

func (oa *baseOauth2) GetOauthUserInfo(token string) (*oauth2User, error) {
Expand Down
2 changes: 1 addition & 1 deletion manager/service/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (s *rest) OauthSignin(name string) (string, error) {
if err != nil {
return "", err
}
return o.AuthCodeURL("state"), nil
return o.AuthCodeURL(), nil
}

func (s *rest) OauthCallback(name, code string) (*model.User, error) {
Expand Down

0 comments on commit 8ddefea

Please # to comment.