• Changes the active role of an ongoing session.

    Warning: This only works for nonprivileged roles. Use requestPrivilegedRoleSwitch for privileged roles.

    Parameters

    • session: SessionId | Session

      The session to change the role of.

    • newRole: Role

      The new role to switch to.

    Returns Promise<Session>

    The updated session.