Sign in / register UI in a modal or separate page

Is there any research or best practice guidelines on the most appropriate solution for this UI from an experience perspective?

Are there known advantages and disadvantages of each?