How can I stop my player from jumping off of vertical surfaces?

I have cubes in my scene, and when I jump with the player while standing next to a cube, it gets a sort of extra boost up from several jumps while traveling up the side of the cube. I would exclude it using a tag, but I want the player to still be able to jump while on top of the cube. Any suggestions? Below is a clip of the normal jump and here is a clip of what the problem is: 191306-ezgifcom-gif-maker.gifHere is my Player Jumping code:

public bool isJumping;
public float jumpSpeed;

void Start()
    {
         isJumping = false;
    }

void OnCollisionStay(Collision col)
    {
        isJumping = false;

        rb.drag = 1f;
        speed = 1000f;

        if (col.gameObject.tag != "Wall")
        {
            if (!isJumping && Input.GetKey(KeyCode.Space))
            {
                rb.AddForce(target.transform.up * jumpSpeed);
            }
        }
    }

void OnCollisionExit()
    {
        isJumping = true;
        rb.drag = .1f;
        speed = 100f;
    }

Set a groundCheck for your player that is fixed near the bottom somewhere (If you want to be able to climb up some of the walls you can add a wallCheck aswell)
then do Physics.CheckSphere to check if you are touching ground and only jump when touching ground.
Make sure when checking for collisions you only check in a small radius below the player and not all around.