Hi @hkchakladar,
Have you tried to not re-declare the app, but just re-use the same, kept as global? Having a different app, hence a different currentUser() object, may be the issue here.
app
currentUser()