mongodb-starter icon indicating copy to clipboard operation
mongodb-starter copied to clipboard

permission error?

Open vorcigernix opened this issue 3 years ago • 1 comments

I just cloned the repo locally, set env.local with correct values and the app works (display placeholders) until I click on login with github. I assume it tries to create a user in database and there are some missing rights. Error is


[next-auth][error][adapter_error_getUserByAccount] 
https://next-auth.js.org/errors#adapter_error_getuserbyaccount cannot do raw queries on admin in atlas {
  message: 'cannot do raw queries on admin in atlas',

Edit: I copied mongo connect string from vercel, is seems to be the source of issue

vorcigernix avatar Jun 14 '22 09:06 vorcigernix

And here is how to fix it: replace /admin part of connection string with /?retryWrites=true&w=majority

vorcigernix avatar Jun 14 '22 09:06 vorcigernix