Implements login and add csrf.