Skip to content

Commit

Permalink
remove HandleTokenRequestWithDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
LyricTian committed Aug 30, 2018
1 parent fe6b4e8 commit e975862
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,26 +503,6 @@ func (s *Server) HandleTokenRequest(w http.ResponseWriter, r *http.Request) (err
return
}

// HandleTokenRequestWithDuration token request handling with personal time.Duration
func (s *Server) HandleTokenRequestWithDuration(w http.ResponseWriter, r *http.Request, duration time.Duration) (err error) {
gt, tgr, verr := s.ValidationTokenRequest(r)
if verr != nil {
err = s.tokenError(w, verr)
return
}

tgr.AccessTokenExp = duration

ti, verr := s.GetAccessToken(gt, tgr)
if verr != nil {
err = s.tokenError(w, verr)
return
}

err = s.token(w, s.GetTokenData(ti), nil)
return
}

// GetErrorData get error response data
func (s *Server) GetErrorData(err error) (data map[string]interface{}, statusCode int, header http.Header) {
re := new(errors.Response)
Expand Down

0 comments on commit e975862

Please sign in to comment.