diff --git a/examples/getstarted/src/index.js b/examples/getstarted/src/index.js index e65dbed916..73440f9b76 100644 --- a/examples/getstarted/src/index.js +++ b/examples/getstarted/src/index.js @@ -19,19 +19,24 @@ module.exports = { async bootstrap({ strapi }) { // Delete tokens // const tokens = await strapi.admin.services['api-token'].list(); + // console.log('tokens', tokens); // const promises = []; // tokens.forEach(({ id }) => { // promises.push(strapi.admin.services['api-token'].revoke(id)); // }); // await Promise.all(promises); - // Create a token + // // Create a token // const payload = { // type: 'custom', - // permissions: ['api::restaurant.create'], + // permissions: ['api::restaurant.restaurant.find'], // name: 'custom token v2', // }; // const token = await strapi.admin.services['api-token'].create(payload); // console.log('custom-before', JSON.stringify(token, null, 2)); + // // TODO: Really need to allow update without full permissions array! + // await strapi.admin.services['api-token'].update(token.id, { + // lastUsed: new Date(), + // }); // const updatedToken = await strapi.admin.services['api-token'].update(token.id, { // description: 'foobar', // permissions: ['api::restaurant.restaurant.find', 'api::restaurant.restaurant.findOne'],