update invocations of MintToken and DismantleToken

This commit is contained in:
David Christofas
2021-05-11 14:18:43 +02:00
parent 8b195e95b6
commit f6ac50244b
6 changed files with 31 additions and 6 deletions
+7 -2
View File
@@ -1,6 +1,7 @@
package middleware
import (
"github.com/cs3org/reva/pkg/auth/scope"
"github.com/owncloud/ocis/proxy/pkg/user/backend"
"net/http"
@@ -91,8 +92,12 @@ func (m accountResolver) ServeHTTP(w http.ResponseWriter, req *http.Request) {
m.logger.Debug().Interface("claims", claims).Interface("user", u).Msgf("associated claims with uuid")
}
token, err := m.tokenManager.MintToken(req.Context(), u)
s, err := scope.GetOwnerScope()
if err != nil {
m.logger.Error().Err(err).Msgf("could not get owner scope")
return
}
token, err := m.tokenManager.MintToken(req.Context(), u, s)
if err != nil {
m.logger.Error().Err(err).Msgf("could not mint token")
w.WriteHeader(http.StatusInternalServerError)