This commit is contained in:
Jan-Lukas Else 2020-11-10 07:45:32 +01:00
parent 3a4338ded2
commit 902f0f55e8
2 changed files with 5 additions and 2 deletions

View File

@ -144,6 +144,7 @@ func buildHandler() (http.Handler, error) {
// ActivityPub and stuff
if appConfig.ActivityPub.Enabled {
r.Post("/activitypub/inbox/{blog}", apHandleInbox)
r.Post("/activitypub/{blog}/inbox", apHandleInbox)
r.Get("/.well-known/webfinger", apHandleWebfinger)
r.Get("/.well-known/host-meta", handleWellKnownHostMeta)
}

View File

@ -268,8 +268,10 @@ func (data *indieAuthData) saveToken() (err error) {
func verifyIndieAuthToken(token string) (data *indieAuthData, err error) {
token = strings.ReplaceAll(token, "Bearer ", "")
data = &indieAuthData{}
row, err := appDbQueryRow("select time, token, me, client, scope from indieauthtoken where token = ?", token)
data = &indieAuthData{
Scopes: []string{},
}
row, err := appDbQueryRow("select time, token, me, client, scope from indieauthtoken where token = @token", sql.Named("token", token))
if err != nil {
return nil, err
}