Yōten: A social tracker for your language learning journey built on the atproto.

feat(oauth/handler): add client name and uri to metadata responses

Signed-off-by: brookjeynes <me@brookjeynes.dev>

authored by brookjeynes.dev and committed by

Tangled d701f58c 2de6115f

+7
+2
internal/server/oauth/consts.go
··· 1 package oauth 2 3 const ( 4 SessionName = "yoten-oauth-session-v2" 5 SessionHandle = "handle" 6 SessionDid = "did"
··· 1 package oauth 2 3 const ( 4 + ClientName = "Yoten" 5 + ClientURI = "yoten.app" 6 SessionName = "yoten-oauth-session-v2" 7 SessionHandle = "handle" 8 SessionDid = "did"
+5
internal/server/oauth/handler.go
··· 30 } 31 32 func (o *OAuth) clientMetadata(w http.ResponseWriter, r *http.Request) { 33 doc := o.ClientApp.Config.ClientMetadata() 34 doc.JWKSURI = &o.JwksUri 35 36 w.Header().Set("Content-Type", "application/json") 37 if err := json.NewEncoder(w).Encode(doc); err != nil {
··· 30 } 31 32 func (o *OAuth) clientMetadata(w http.ResponseWriter, r *http.Request) { 33 + clientName := ClientName 34 + clientUri := ClientURI 35 + 36 doc := o.ClientApp.Config.ClientMetadata() 37 doc.JWKSURI = &o.JwksUri 38 + doc.ClientName = &clientName 39 + doc.ClientURI = &clientUri 40 41 w.Header().Set("Content-Type", "application/json") 42 if err := json.NewEncoder(w).Encode(doc); err != nil {