Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logout error #8760

Closed
exoer opened this issue Oct 17, 2024 · 2 comments
Closed

Logout error #8760

exoer opened this issue Oct 17, 2024 · 2 comments
Labels

Comments

@exoer
Copy link

exoer commented Oct 17, 2024

Describe the Bug

I made an payload app with

Logging out from the UI gives an 400 error

  errors
  : 
    [{message: "No User"}]
    0
    : 
  {message: "No User"}
message
: 
"No User"```


```Failed to load resource: the server responded with a status of 400 ()```

![Image](https://github.com/user-attachments/assets/3ed89df2-f6db-40cc-9f8b-0d3980daaf8e)

So I still can see the logged in state and all the collections. But I am now allowed to make any changes.

--- 
Possible explanation.

I deployed the payloadCMS to a server. I created a user with an empty database.

Later I copied a database from dev to production with `mongodump` and `mongorestore`. 

It has also overwritten the Users collection. And now I cannot logout. I've tried to clear the cookies from the browser, and use other browsers and incognito/private mode. But I still stay logged in with an invalid user.

I think it would be nice if `logout` was more robust and handled the case with no user.


### Link to the code that reproduces this issue

npx create-payload-app@beta -t blank

### Reproduction Steps

npx create-payload-app@beta -t blank

deploy app

create new user on the /admin route.

copy dev database to production with `mongodump - mongorestore`

try to logout


### Which area(s) are affected? (Select all that apply)

area: core

### Environment Info

# pnpm payload info

> [email protected] payload /app
> cross-env NODE_OPTIONS=--no-deprecation payload "info"


Binaries:
  Node: 22.3.0
  npm: 10.8.1
  Yarn: N/A
  pnpm: 9.12.1
Relevant Packages:
  payload: 3.0.0-beta.114
  next: 15.0.0-canary.173
  @payloadcms/db-mongodb: 3.0.0-beta.114
  @payloadcms/email-nodemailer: 3.0.0-beta.114
  @payloadcms/graphql: 3.0.0-beta.114
  @payloadcms/live-preview: 3.0.0-beta.114
  @payloadcms/live-preview-react: 3.0.0-beta.114
  @payloadcms/next/utilities: 3.0.0-beta.114
  @payloadcms/plugin-cloud: 3.0.0-beta.114
  @payloadcms/plugin-cloud-storage: 3.0.0-beta.114
  @payloadcms/plugin-form-builder: 3.0.0-beta.114
  @payloadcms/plugin-nested-docs: 3.0.0-beta.114
  @payloadcms/plugin-redirects: 3.0.0-beta.114
  @payloadcms/plugin-search: 3.0.0-beta.114
  @payloadcms/plugin-seo: 3.0.0-beta.114
  @payloadcms/richtext-lexical: 3.0.0-beta.114
  @payloadcms/storage-s3: 3.0.0-beta.114
  @payloadcms/translations: 3.0.0-beta.114
  @payloadcms/ui/shared: 3.0.0-beta.114
  react: 19.0.0-rc-3edc000d-20240926
  react-dom: 19.0.0-rc-3edc000d-20240926
Operating System:
  Platform: linux
  Arch: arm64
  Version: #38-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun  7 17:43:15 UTC 2024
  Available memory (MB): 7730
  Available CPU cores: 4
@exoer exoer added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Oct 17, 2024
@exoer
Copy link
Author

exoer commented Oct 17, 2024

I may be mistaken about the cause of this issue.

@exoer exoer closed this as completed Oct 17, 2024
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Oct 17, 2024
Copy link

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant