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

* authenticate: add callback endpoint

* webauthn: use absolute URL for delete redirect
This commit is contained in:
Caleb Doxsey 2022-01-14 10:23:27 -07:00 committed by GitHub
parent b019b61ccb
commit 8d882ce9c9
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"
@ -340,7 +341,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 {