Skip to content

Commit

Permalink
handle empty redirect URL (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
flokli committed May 23, 2023
1 parent 0b91d50 commit 3488093
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/oauth2/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ func WaitForCallback(clientConfig ClientConfig, serverConfig ServerConfig, hc *h
}

srv.Addr = redirectURL.Host
if redirectURL.Path == "" {
redirectURL.Path = "/"
}

http.HandleFunc(redirectURL.Path, func(w http.ResponseWriter, r *http.Request) {
defer func() {
Expand Down

0 comments on commit 3488093

Please sign in to comment.