bug: fix bad callback url for programmatic (#381)

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
Bobby DeSimone 2019-11-09 16:43:44 -08:00 committed by GitHub
parent b9ab49c32c
commit c6ebd838e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,7 +118,6 @@ func (a *Authenticate) SignIn(w http.ResponseWriter, r *http.Request) {
// create a clone of the redirect URI, unless this is a programmatic request
// in which case we will redirect back to proxy's callback endpoint
callbackURL, _ := urlutil.DeepCopy(redirectURL)
callbackURL.Path = "/.pomerium/callback"
q := redirectURL.Query()
@ -163,6 +162,8 @@ func (a *Authenticate) SignIn(w http.ResponseWriter, r *http.Request) {
redirectURL.RawQuery = q.Encode()
callbackURL.Path = "/.pomerium/callback"
// build our hmac-d redirect URL with our session, pointing back to the
// proxy's callback URL which is responsible for setting our new route-session
uri := urlutil.SignedRedirectURL(a.sharedKey, callbackURL, redirectURL)