changing auth to a plugin