Moving auth ajax to x-authentication element