After making all changes to the code and passing the test, I still can’t get a validation code from the webpage. i get this error message: “invalid response to update preferences - login of user failed”.
How was this solved? Encountering same problem.
In “createUserSession” when “user_id” is already in the Session collection you have to update the session document with new jwt. i was returning false when user_id existed in the session collection. that was the problem for me. i Hope that helps you.
Got it, I had an insert but really should have been doing upsert.