Instead, before calling the function to generate the view matrix, the up_vector should be determined from the vector from the light position to the look_at target: if the vector is parallel to (0, 0, 1), then the up_vector should be (0, 1, 0), otherwise it should be (0, 0, 1).
For generating shadow maps, the up vector doesn't actually matter. It might be a good idea to keep the option to specify the up vector for spot lights though, if a texture is employed to allow the light to project a texture as well.
Instead, before calling the function to generate the view matrix, the up_vector should be determined from the vector from the light position to the look_at target: if the vector is parallel to (0, 0, 1), then the up_vector should be (0, 1, 0), otherwise it should be (0, 0, 1).
For generating shadow maps, the up vector doesn't actually matter. It might be a good idea to keep the option to specify the up vector for spot lights though, if a texture is employed to allow the light to project a texture as well.