Reimplemented login process using Token class