Just to make sure I'm on the same page...the pin that connects the two hinge plates is coming out on its own?
You can try taking the pin out and lightly hammering the middle knuckle so it's pinches the pin more. Alternatively, hammer a slight bend in the pin.
They also make pins that go through the hinges and screw on