Added a lot of login code. still some work left. currently authorization isn't working properly