Mediahandler (#21)

Media GET and media PUT handlers
This commit is contained in:
Tobi Smethurst 2021-05-10 16:29:05 +02:00 committed by GitHub
commit 742f985d5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 322 additions and 56 deletions

View file

@ -35,9 +35,10 @@ func (m *Module) OauthTokenMiddleware(c *gin.Context) {
ti, err := m.server.ValidationBearerToken(c.Request)
if err != nil {
l.Trace("no valid token presented: continuing with unauthenticated request")
l.Tracef("could not validate token: %s", err)
return
}
l.Trace("continuing with unauthenticated request")
c.Set(oauth.SessionAuthorizedToken, ti)
l.Tracef("set gin context %s to %+v", oauth.SessionAuthorizedToken, ti)