[plugins] auth: some code cleanup