Move login/logout methods to the raw context.
Extract logic to `loggedInWithRole()`.