Login and register functionality
Added redirection for not logged in