Fix isauth variable scoping errors