Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Kunz committed Oct 11, 2024
1 parent 3f77fd0 commit 5efd11c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cds-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,18 +326,14 @@ class EventBroker extends cds.MessagingService {
Object.assign(msg.headers, headers)
if (this.isMultitenancy) msg.tenant = tenant

// do not set cds.context.http
//msg._ = {}
//msg._.req = req
//msg._.res = res

const context = { user: cds.User.privileged, /*_: msg._*/ }
const context = { user: cds.User.privileged }
if (msg.tenant) context.tenant = msg.tenant

await this.tx(context, tx => {
delete cds.context.http.req.headers.authorization
delete cds.context.http.req.headers.authorization // potential destination lookup fails if IAS token is used
return tx.emit(msg)
})

this.LOG.debug('Event processed successfully.')
return res.status(200).json({ message: 'OK' })
} catch (e) {
Expand Down

0 comments on commit 5efd11c

Please sign in to comment.