pocketbase / dart-sdk

PocketBase Dart SDK
https://pub.dev/packages/pocketbase
MIT License
512 stars 51 forks source link

Unable to Login #4

Closed mukhtharcm closed 2 years ago

mukhtharcm commented 2 years ago

I'm unable to log in to pocketbase with the users' method. But I'm able to log in with the admins' method.

When trying to login, I'm getting this error

{
  "errorDetails": "sql: no rows in result set",
  "errorMessage": "Failed to authenticate."
}

Any Idea?

irmhonde commented 2 years ago

Hi @mukhtharcm. Only way I've successfully reproduced that error is intentionally passing incorrect email. Could it be possible you've done the same? If not, are you using authViaEmail() or authViaOAuth()? If possible, please provide code block

ganigeorgiev commented 2 years ago

@mukhtharcm Users and Admins are 2 separate entities (they have their own tables, different authorization schemas, etc.), or in other words - you can use client.users.authViaEmail() only with user accounts.

As irmhonde mentioned, the above error is most likely caused because a user account with the email address you are trying to login doesn't exist (the error is intentionally generic to prevent users/admins enumerations).

mukhtharcm commented 2 years ago

@ganigeorgiev @irmhonde Thank you guys, I misunderstood that PocketBase didn't have any separate method for signing Up. I was trying to create a new user. I just had a close look at docs and found that there is a separate .create method.