Bookshop showing user info

Show current user name, locale and tenant (if available).
Useful in deployments w/ real auth and tenant contexts.
This commit is contained in:
Christian Georgi
2022-03-28 13:54:16 +02:00
committed by Christian Georgi
parent 5fc86d45ad
commit bb55c432c9
5 changed files with 68 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
const cds = require('@sap/cds');
module.exports = cds.service.impl((srv) => {
srv.on('READ', 'Me', ({ user }) => {
return {
ID: user.id,
locale: user.locale,
tenant: user.tenant,
};
});
});