Skip to content

Commit

Permalink
Fixed the encoded redirect_uri issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
YasuhiroABE committed Apr 23, 2024
1 parent 677ab36 commit 021279b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,11 @@ func (s *Server) calculateCodeChallenge(codeVerifier, codeChallengeMethod string
func (s *Server) handleAuthCode(w http.ResponseWriter, r *http.Request, client storage.Client) {
ctx := r.Context()
code := r.PostFormValue("code")
redirectURI := r.PostFormValue("redirect_uri")
redirectURI, err := url.QueryUnescape(r.PostFormValue("redirect_uri"))
if err != nil {
s.tokenErrHelper(w, errInvalidRequest, "No redirect_uri provided.", http.StatusBadRequest)
return
}

if code == "" {
s.tokenErrHelper(w, errInvalidRequest, `Required param: code.`, http.StatusBadRequest)
Expand Down

0 comments on commit 021279b

Please sign in to comment.