this repo has no description
1package handler
2
3import (
4 "encoding/json"
5 "net/http"
6
7 "tangled.org/core/appview/oauth"
8)
9
10func OauthJwks(o *oauth.OAuth) http.HandlerFunc {
11 return func(w http.ResponseWriter, r *http.Request) {
12 w.Header().Set("Content-Type", "application/json")
13 body := o.ClientApp.Config.PublicJWKS()
14 if err := json.NewEncoder(w).Encode(body); err != nil {
15 http.Error(w, err.Error(), http.StatusInternalServerError)
16 return
17 }
18 }
19}