I am creating command line interface by using node.js. It has login feature and after login, needs to show output based on user selection from list. Problem i'm facing is it exits from the node after first result. It's asking login again. It should not exit, if exit from app also fine but, still i should able to fetch the logged in user detail. Say example it displays user details when I selects Show user profile
from the list. Now, I exit from app(not from the cli console). Again i have to login to see other result. Instead of that can we maintain any session kind of thing for the logged in user so that we can allow user to enter into system without login again and again. Or suggest me any other solution to do this. !
Sorry for my bad English. Hope you understand my problem. (attached an image)
I am using inquirer for user inputs, commander for help and request for HTTP operations. I can share my code if needed.