Fix IndieAuth

This commit is contained in:
Jan-Lukas Else 2021-11-22 23:21:47 +01:00
parent 1718a70d8a
commit b16b8c9531
1 changed files with 3 additions and 3 deletions

View File

@ -136,7 +136,7 @@ func (a *goBlog) indieAuthVerification(w http.ResponseWriter, r *http.Request) {
return
}
b, _ := json.Marshal(tokenResponse{
Me: a.cfg.Server.PublicAddress,
Me: a.getFullAddress("") + "/", // MUST contain a path component / trailing slash
})
w.Header().Set(contentType, contenttype.JSONUTF8)
_, _ = a.min.Write(w, contenttype.JSON, b)
@ -152,7 +152,7 @@ func (a *goBlog) indieAuthToken(w http.ResponseWriter, r *http.Request) {
}
res := &tokenResponse{
Scope: strings.Join(data.Scopes, " "),
Me: a.cfg.Server.PublicAddress,
Me: a.getFullAddress("") + "/", // MUST contain a path component / trailing slash
ClientID: data.ClientID,
}
b, _ := json.Marshal(res)
@ -206,7 +206,7 @@ func (a *goBlog) indieAuthToken(w http.ResponseWriter, r *http.Request) {
TokenType: "Bearer",
AccessToken: data.token,
Scope: strings.Join(data.Scopes, " "),
Me: a.cfg.Server.PublicAddress,
Me: a.getFullAddress("") + "/", // MUST contain a path component / trailing slash
}
b, _ := json.Marshal(res)
w.Header().Set(contentType, contenttype.JSONUTF8)