Suppose an unauthenticated user tries to get the page which only authorized users can see: /profile/preferences
Is it a normal practice to reply to this with 401 Unauthorized along with the content of the login page or is it better to serve 302 Found redirect to the login page and then send the user back to /profile/preferences?
What are advantages and disadvantages of each method? Can you provide examples of sites using first method?