prismicio / slice-machine

A series of tools for developing and deploying website sections with Prismic
https://prismic.io/docs
Apache License 2.0
287 stars 53 forks source link

Login doesn't work (v0.7.0) #1021

Closed kb1995 closed 1 year ago

kb1995 commented 1 year ago

Versions

This is a critical bug (I also posted it in the community forum - https://community.prismic.io/t/slice-machine-cant-push-changes-as-im-constantly-logged-out/13509/2)

My company is not in a position to upgrade to >1.0 now (I'm also not sure if this bug is caused by being on 0.7 as one of my colleagues doesn't have this issue), but for now when I tried to create a new slice and push it to the Prismic repo, I get an error that I'm not logged in even after I get a success message I'm logged in. Thus I'm stuck in an infinite cycle. What can I do to be able to push changes to Prismic.

Screenshot 2023-06-26 at 11 17 50 Screenshot 2023-06-26 at 11 17 55 Screenshot 2023-06-26 at 11 17 59
mdeclercq commented 1 year ago

Hi @kb1995,

Thanks for reporting the issue. We were not able to reproduce it and have a few questions to get a better understanding.

You mentioned your colleagues don't have the issue so I suppose the configuration is fine. But I need to ask:

The reason I am asking this is because SliceMachine doesn't properly handle the case where a user tries to access a repository it can't read. This can happen when the user doesn't have the permission on the repo or if the repo is misspelled. When this happens, it shows the Logged in confirmation message but never allows to push changes, just like in your screenshots.

Thanks,

kb1995 commented 1 year ago

@mdeclercq Thanks for the reply!

  1. It has never worked for me - I recently took over this repo and I just tried to publish a new change but it didn't work
  2. I haven't encountered this in other repos
  3. sm.json is correct
  4. I do have "Writer" access to the repo

The only thing on my mind is that I need to have admin access in order to push slice machine changes. Is that the case?

mdeclercq commented 1 year ago

Thanks for replying @kb1995, You're right, as SliceMachine involves editing Content Types / Slices, you need to ask an Admin or Repository owner to give you the Administrator permission. You can find more information about roles on https://prismic.io/docs/guides/manage-users#user-roles.

Let us know if that solves the issue.

Fyi, the team is aware that this kind of scenario could be handled better by SliceMachine but it's not a priority to fix it right now.

kb1995 commented 1 year ago

Thanks @mdeclercq - this fixed the issue! I'm surprised that there is not at least a warning to point me in the right direction...

mdeclercq commented 1 year ago

Glad to see this resolved the issue.

I'm surprised that there is not at least a warning to point me in the right direction...

We created an internal ticket to improve that.

codermuyi commented 8 months ago

slice-machine-ui: 10.2.3 I am experiencing the same issue but I am an Administrator and the repository owner. I haven't been able to push any models.