Realm unconfirmed user login error

Hello!

I’ve been working on a Flutter app that uses Realm for authentication. I’m facing an issue where when I’m trying to login with email and password and I use anything but a valid pair of email and password ( wrong password, unconfirmed account) I’m getting a ‘401 Unauthorized’ error.

I was using the different error messages to handle the errors on the UI before and it worked fine but now they all return the same irrelevant error so that isn’t working anymore.

The authentication is configured correctly, I can login if I use valid credentials, I can create new accounts, all of that seems to work fine so I was wondering if there were some breaking changes in how the errors are handled that I was not aware of.

Thanks a lot!

1 Like

Hi @Cioloca_Rares,

Sorry for the inconvenience. This was changed in Realm Core v13.5.0 which was released on Feb 24, 2023. The first Flutter SDK release that incorporated this change was v1.0.3, released on Mar 20, 2023. There was a project to unify some of our error codes and make them a bit more uniform and unfortunately, the specific login failure error codes were removed in favor reporting the error message from the server, which should be descriptive enough to display to the user as to why the login (or other App Services operation) failed.

If you have a recommendation for improving the error messages, feel free to submit an issue in the Realm Core repo (GitHub - realm/realm-core: Core database component for the Realm Mobile Database SDKs) and we will review it.

Thank you for using the Flutter SDK

-Michael

Hi @Michael_Wilkerson-Barker ,

Thanks for your answer. As I mentioned, the message from the server is just ‘401 Unauthorized’ for both wrong credentials and unconfirmed user which is definitely not enough to tell the two cases apart. Could it be an issue that a login with unconfirmed credentials is mistakenly treated as a login with non-existing credentials? Seems to me like this might be the case and it’s a bug that needs to be fixed.

Thanks you!

@Michael_Wilkerson-Barker I’m having the exact same issue on all my projects. This is very frustrating from a user experience perspective. I do see that there are more descriptive error messages in the server logs. Can you direct me to instructions on how to access those messages from my app? Also just as feedback, it would be really nice to get a heads up of such changes that clearly require a change on our end to provide an understandable experience to our users.

For reference I’m using the Swift SDK