I have a pretty simple goal: re-validate a logged-in user’s email and password credentials before setting a new password.
The only way I’ve found to do this is to call app.logIn with the currentUser email and the password as entered by the user. If the credentials are valid, the app should proceed with a password reset, otherwise it would error. I already have a working “forgot password” flow, but I wanted a different flow for a user that’s already logged in involving re-validating the credentials.
The problem is that the app freezes when it gets to await app.logIn(<Valid Credentials>). It throws as expected if the credentials are invalid. I see a successful authorization in my Atlas log but the Promise never resolves.
Is there any way to achieve the desired effect of “re-validating” a logged-in user’s credentials?
Tech stuff:
I’m using app from the useApp hook, just as I am during the initial login
This actually worked as expected before I upgraded my npm packages, including Realm (I was prompted to upgrade in order to migrate from a partitioned sync to a flexible sync). I went from 10.24.0 to 12.0.0
Also of note, I’m not using the UserProvider fallback pattern, as this caused other problems. I’m not sure if it’s relevant, but since the issue seems to happen when trying to sign in with the same user that’s already signed in, I thought I’d mention it.
I have only checked this behavior on Android. It happens every time I try to validate the current user’s password as shown
Unfortunately, every time I try to run the app with the log level set they way you said, it crashes the app before I can do anything. I can’t tell if this is a problem with Realm or my dev environment.
After logging this out a few times, I’m seeing that Initiate commit version changes every time but the Commit of size 2320 done is consistently where it stops
@Nick_Martin Sorry for no response. We are trying to figure this out. There is a case where we want to update the refresh tokens before they expire, by essentially logging in again. This seems to lockup the UI for some reason and I believe it is related. If we get it fixed, I will be sure to update you!