made user authentication from scratch