improved authplugin