The button doesnβt actually open the link - it just runs some kind of javascript code, which, in this case, should go to the new URL. Thus, the target="_blank" attribute on the button will not help.
Instead, you need to use javascript commands to open a new tab / window, and not use javascript to change the url of the current window. Assigning location.href will only change the URL of the current window.
Instead, use the window.open(url, target) function β this requires a URL and the name of the target window, which behaves the same as the target="whatever" attribute on the link.
window.open('auth/google', '_blank');
Your complete code would look like this:
button(type="button", onclick="window.open('auth/google', '_blank');")
source share