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

[🐛] Problem with Basket (New User) #1466

Closed
HigorGabrielDCF opened this issue Sep 17, 2020 · 2 comments
Closed

[🐛] Problem with Basket (New User) #1466

HigorGabrielDCF opened this issue Sep 17, 2020 · 2 comments
Assignees
Labels

Comments

@HigorGabrielDCF
Copy link

HigorGabrielDCF commented Sep 17, 2020

After logging in, the application checks whether the user has a basket, otherwise a new basket with a new ID is created. But always create a new one, after login.

I reviewed the code in the file "routes / login.js" and found the error, it is a case-sensitive problem. userId != UserId

Line 16:

models.Basket.findOrCreate({ where: { userId: user.data.id }, defaults: {} })

but the correct is

models.Basket.findOrCreate({ where: { UserId: user.data.id }, defaults: {} })

Version of JuiceShop: 12.0.2
Version of NodeJS: v12.18.3

@github-actions
Copy link

Thanks a lot for opening your first issue with us! 🧡 We'll get back to you shortly! ⏳ If it was a Support Request, please consider asking on the community chat next time! 💬

@github-actions
Copy link

This thread has been automatically locked because it has not had recent activity after it was closed. 🔒 Please open a new issue for regressions or related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2021
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

2 participants