webauthn: use absolute URL for delete redirect (#2935) (#2937)

* authenticate: add callback endpoint

* webauthn: use absolute URL for delete redirect

Co-authored-by: Caleb Doxsey <cdoxsey@pomerium.com>
This commit is contained in:
backport-actions-token[bot] 2022-01-18 09:49:10 -07:00 committed by GitHub
parent 2e333a2328
commit e0edfb8518
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,7 @@ import (
"io"
"net"
"net/http"
"net/url"
"github.com/google/uuid"
"github.com/pomerium/csrf"
@ -345,7 +346,9 @@ func (h *Handler) handleUnregister(w http.ResponseWriter, r *http.Request, state
// remove the credential from the session
state.Session.DeviceCredentials = removeSessionDeviceCredential(state.Session.DeviceCredentials, deviceCredentialID)
return h.saveSessionAndRedirect(w, r, state, "/.pomerium")
return h.saveSessionAndRedirect(w, r, state, urlutil.GetAbsoluteURL(r).ResolveReference(&url.URL{
Path: "/.pomerium",
}).String())
}
func (h *Handler) handleView(w http.ResponseWriter, r *http.Request, state *State) error {