moved auth code into own class. modified function name in patronapi lib