Maybe you can check for a response which indicates successful authentication. I guess just checking the res.code could work.