From 6dd6581d41481c4df61b51f3c261e89e8653e1e7 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 28 Sep 2026 08:50:36 +0200 Subject: [PATCH] feat: login through new tab --- browser/src/auth.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/browser/src/auth.ts b/browser/src/auth.ts index 79e4f93..aded4c4 100644 --- a/browser/src/auth.ts +++ b/browser/src/auth.ts @@ -17,6 +17,14 @@ export const login = ( returnTo?: URL ) => { location.href = url.toString(); }; +/** Log in a user in a new browser tab or window */ +export const loginInNewTab = () => { + const url = getBackendURL(); + + url.pathname = config.get().loginEndpoint ?? '/auth/v2/login'; + window.open( url.toString() ); +}; + /** * Check if a user is authenticated. This can also be done implicitly using a call to a protected endpoint * @returns A promise resolving to a boolean indicating authentication status