Files
opencloud/extensions/web/pkg/middleware/silentrefresh.go
Christian Richter e5abc25aa1 refactor web
Signed-off-by: Christian Richter <crichter@owncloud.com>
2022-04-13 17:04:38 +02:00

14 lines
335 B
Go

package middleware
import (
"net/http"
)
// SilentRefresh allows the oidc client lib to silently refresh the token in an iframe
func SilentRefresh(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
next.ServeHTTP(w, r)
})
}