authenticate: have an option to trim the contents of the callback (#4090)

This commit is contained in:
Denis Mishin 2023-03-31 11:48:31 -04:00 committed by GitHub
parent 7d53575bdb
commit 860a881fe0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -212,6 +212,10 @@ func (a *Authenticate) SignIn(w http.ResponseWriter, r *http.Request) error {
return httputil.NewError(http.StatusBadRequest, err)
}
if a.cfg.profileTrimFn != nil {
a.cfg.profileTrimFn(profile)
}
redirectTo, err := urlutil.CallbackURL(state.hpkePrivateKey, proxyPublicKey, requestParams, profile)
if err != nil {
return httputil.NewError(http.StatusInternalServerError, err)