mirror of
https://github.com/strapi/strapi.git
synced 2025-08-10 09:47:46 +00:00
update testing (remove all later)
This commit is contained in:
parent
e28c9e7ec9
commit
4f46d57de0
@ -19,19 +19,24 @@ module.exports = {
|
|||||||
async bootstrap({ strapi }) {
|
async bootstrap({ strapi }) {
|
||||||
// Delete tokens
|
// Delete tokens
|
||||||
// const tokens = await strapi.admin.services['api-token'].list();
|
// const tokens = await strapi.admin.services['api-token'].list();
|
||||||
|
// console.log('tokens', tokens);
|
||||||
// const promises = [];
|
// const promises = [];
|
||||||
// tokens.forEach(({ id }) => {
|
// tokens.forEach(({ id }) => {
|
||||||
// promises.push(strapi.admin.services['api-token'].revoke(id));
|
// promises.push(strapi.admin.services['api-token'].revoke(id));
|
||||||
// });
|
// });
|
||||||
// await Promise.all(promises);
|
// await Promise.all(promises);
|
||||||
// Create a token
|
// // Create a token
|
||||||
// const payload = {
|
// const payload = {
|
||||||
// type: 'custom',
|
// type: 'custom',
|
||||||
// permissions: ['api::restaurant.create'],
|
// permissions: ['api::restaurant.restaurant.find'],
|
||||||
// name: 'custom token v2',
|
// name: 'custom token v2',
|
||||||
// };
|
// };
|
||||||
// const token = await strapi.admin.services['api-token'].create(payload);
|
// const token = await strapi.admin.services['api-token'].create(payload);
|
||||||
// console.log('custom-before', JSON.stringify(token, null, 2));
|
// 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, {
|
// const updatedToken = await strapi.admin.services['api-token'].update(token.id, {
|
||||||
// description: 'foobar',
|
// description: 'foobar',
|
||||||
// permissions: ['api::restaurant.restaurant.find', 'api::restaurant.restaurant.findOne'],
|
// permissions: ['api::restaurant.restaurant.find', 'api::restaurant.restaurant.findOne'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user