diff --git a/browser/src/auth.ts b/browser/src/auth.ts index 0ebfeae..316a85c 100644 --- a/browser/src/auth.ts +++ b/browser/src/auth.ts @@ -3,9 +3,9 @@ import request, { } from './request.js'; import config from './config.js'; -export const login = () => { +export const login = ( returnTo?: string ) => { sessionStorage.setItem( 'redirect', location.pathname ); - location.href = config.get().loginEndpoint ?? '/auth/v2/login'; + location.href = ( config.get().loginEndpoint ?? '/auth/v2/login' ) + returnTo ? returnTo : ''; }; export const check = async () => {