Set DB before authentication

This is required by Moped