Made authentication works on client side.