Refactor fetch auth function

The following discussion from !3362 should be addressed:

  • @m.holst started a discussion: (+1 comment)

    Why do we need this wrapper here? Looks like its not needed or? Is not possible to use fetch and localstorage direct inside fetchWithAuthWrapper (which could also be renamed then) and get rid of this wrapper. Would also make the main function a bit more readable. 🤔