diff --git a/browser/src/auth.ts b/browser/src/auth.ts index 240d667..0ebfeae 100644 --- a/browser/src/auth.ts +++ b/browser/src/auth.ts @@ -22,7 +22,10 @@ export const check = async () => { } if ( !status && config.get().checkAutoRedirect ) { - location.href = getRedirect(); + const redir = getRedirect(); + + if ( redir ) + location.href = redir; } return status; diff --git a/browser/src/request.ts b/browser/src/request.ts index 41514a8..7c64ab2 100644 --- a/browser/src/request.ts +++ b/browser/src/request.ts @@ -44,6 +44,8 @@ const wrapper = async ( url: string, opts: RequestInit, authErrorResolution?: Au } else { throw new AuthError( 'ERR_USER_UNAUTHORIZED' ); } + + return res; } else { return res; } diff --git a/browser/tsconfig.json b/browser/tsconfig.json index 57396ca..11e34d5 100644 --- a/browser/tsconfig.json +++ b/browser/tsconfig.json @@ -6,9 +6,6 @@ "target": "ES2022", "skipLibCheck": true, "allowSyntheticDefaultImports": true, - "types": [ - "node" - ], "module": "NodeNext", "moduleResolution": "NodeNext" },