I would only prevent movenet in the direction you know is a dead end.
And I’d do that by directly disabling the input with a bool branch.
Ofc, this depends somewhat on what the game should work like.
But disabling input from further processing is definitely the way to go - as it will allow all other directional inputs. Yet prevent movement in the direction you cannot go.
Can move? Proceed.
Axis > 0 & Can move +Y ? Proceed.
Axis < 0 & can move -Y ? Proceed.
All the branch falses literally do nothing (unless you have to run some code on tick or something, which you can hook into any axis input).
Theoretically, even for 3rd person, if you constrain the movement to the wall/cover axis, then the sideways input won’t matter.
But you could cause a situation where diagonal (.5y, .5x) axis values cause some movement, so you may have to disable the X or the Y entierly depending on the wall world-to-player controller angle or something.