Hi. I’m unable to get the SharesService.login to work properly.
For example, based on this → directus/api/src/services/shares.ts at f55913653b02caa7cf8fbd90a0c2b48108419719 · directus/directus · GitHub, i’m trying the following:
handler: (router, context) => {
const { services, getSchema, logger } = context;
const { ItemsService, SharesService } = services;
router.post('/create', async (req, res) => {
try {
const schema = await getSchema();
const s = new SharesService.login({schema});
const result = await s.login({share: ‘<share_id>‘}, {session: true});
return res.status(200).json(result);
} catch(err) {
logger?.error?.(err);
return res.status(500);
}
}
But instead of getting the directus_session_token in a cookie, i keep receiving just the result object in the Response body.
Why?
How to rectify this code?