Authentication part 2

May be some issues here