Building Neo4j App With NodeJS - Mistake found

Hi there

I think there is a mistake in the Building Neo4j App With NodeJS new course

Chapter -> Interacting with Neo4j
Challenge -> Authenticating a User

If you look at the final Working Solution, you can see that the session is closed almost at the end of the function...which means if there is no user matching the one provided by the UI or if the password is wrong the function will return false and the session will never close.

Is it intentional and there is something I don't understand ?
Because in the register function before we made sure that the session was closed whatever happen.

Good spot, thank you for reporting it. You're correct, because the results are consumed straight away and there are no more interactions with the database the session can be closed. I will get the code updated