How can i rotate 90° into input direction?

My character is a cube in a grid based game. I control it with W,A,S,D as a Vector2D. When pressing W (1, 0) the character will move 100 units forward, when pressing D (0, 1) it will move right etc…
Now i want to archive that the cube also rolls into the direction. This is pretty easy when i reset the rotation to 0,0,0 every time i start but this only works when the character material is something like a single color. Thats why i want to get rid of my old logic and roll from where it is without resetting.

This attempt is working for left and right but as soon as i got forward / backward it is going crazy