pull authentication code into a mixin