Skip to content

Commit 1f86a90

Browse files
committed
fix(login): login in place on web
1 parent 4c8346e commit 1f86a90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/services/trakt.service.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { TraktClient } from '@dvcol/trakt-http-client';
1717

1818
import { TraktApiExtended } from '@dvcol/trakt-http-client/models';
1919

20+
import { chromeRuntimeId } from '@dvcol/web-extension-utils/chrome/runtime';
2021
import { createTab } from '@dvcol/web-extension-utils/chrome/tabs';
2122

2223
import type { JsonWriterOptions } from '@dvcol/common-utils/common/save';
@@ -177,7 +178,8 @@ export class TraktService {
177178
const url = this.traktClient
178179
.redirectToAuthenticationUrl(params)
179180
.replace(`${traktClientSettings.corsProxy}/${traktClientSettings.corsPrefix}`, traktClientSettings.endpoint);
180-
return createTab({ url });
181+
if (chromeRuntimeId) return createTab({ url });
182+
window.location.href = url;
181183
}
182184

183185
static async login(token: string): Promise<{ auth: SettingsAuth; settings: UserSetting }> {

0 commit comments

Comments
 (0)