Admin::SessionsController#create: cannot execute UPDATE in a read-only transaction

On the staging Geo secondary I'm getting this error:

ActiveRecord::StatementInvalid: PG::ReadOnlySqlTransaction: ERROR: cannot execute UPDATE in a read-only transaction

It happens right after entering the 2FA code to enable Admin mode.

Edited by Toon Claes