Skip to content

Commit

Permalink
refactor : remove the receiver of parseToken function
Browse files Browse the repository at this point in the history
  • Loading branch information
CaiCandong committed Jul 6, 2023
1 parent 53b4ad3 commit 93191f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/auth/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (o *OAuth2) Name() string {

// parseToken returns the token from request, and a boolean value
// representing whether the token exists or not
func (o *OAuth2) parseToken(req *http.Request) (string, bool) {
func parseToken(req *http.Request) (string, bool) {
_ = req.ParseForm()
// Check token.
if token := req.Form.Get("token"); token != "" {
Expand Down Expand Up @@ -130,7 +130,7 @@ func (o *OAuth2) Verify(req *http.Request, w http.ResponseWriter, store DataStor
return nil, nil
}

token, ok := o.parseToken(req)
token, ok := parseToken(req)
if !ok {
return nil, nil
}
Expand Down

0 comments on commit 93191f0

Please sign in to comment.