factor out _update_context_for_auth_events
factor out _update_context_for_auth_events

This is duplicated, so let's factor it out before fixing it

matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse,matrix-org/synapse