Skip to content

[BUG] Strapi 5 always logout when I try to create a new content #151

Open
@casgin

Description

@casgin

node -v
v22.13.1

from package.json

  "dependencies": {
    "@strapi/plugin-cloud": "5.12.1",
    "@strapi/plugin-users-permissions": "5.12.1",
    "@strapi/strapi": "5.12.1",
    "better-sqlite3": "11.3.0",
    "react": "^18.0.0",
    "react-dom": "^18.0.0",
    "react-router-dom": "^6.0.0",
    "strapi-plugin-preview-button": "^3.0.0",
    "styled-components": "^6.0.0"
  },

I have create a content type "article"

{
  "kind": "collectionType",
  "collectionName": "articles",
  "info": {
    "singularName": "article",
    "pluralName": "articles",
    "displayName": "article"
  },
  "options": {
    "draftAndPublish": true
  },
  "attributes": {
    "slug": {
      "type": "string"
    },
    "title": {
      "type": "string"
    }
  }
}

have installed plugin with
npm install strapi-plugin-preview-button@latest

and the configuration file is

// config/plugin.js
module.exports = () => ({
    'preview-button': {
    config: {
        enable: true,
      contentTypes: [

        {
          uid: 'api::article.article',
          draft: {
            url: 'http://localhost:3000/api/preview',
            query: {
              type: 'page',
              slug: '{slug}',
            },
          },
          published: {
            url: 'http://localhost:3000/{slug}',
          },
        },
      ],
    },
  },
});

when go to create a new content for api::article.article Strapi log me out !!!

when edit an existing content, preview button does not appear

where is the problem ?
why strapi log me out when plugin is enabled ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions