split log in functions to seperate app. Still need log out page