server: fix oauth2 values and remove unused code

This commit is contained in:
Eric Chiang
2016-08-24 11:14:38 -07:00
parent f219964f16
commit c33ad3e0f3
2 changed files with 3 additions and 23 deletions

View File

@@ -386,9 +386,9 @@ func (s *Server) handleToken(w http.ResponseWriter, r *http.Request) {
grantType := r.PostFormValue("grant_type")
switch grantType {
case "authorization_code":
case grantTypeAuthorizationCode:
s.handleAuthCode(w, r, client)
case "refresh_token":
case grantTypeRefreshToken:
s.handleRefreshToken(w, r, client)
default:
tokenErr(w, errInvalidGrant, "", http.StatusBadRequest)