Skip to content

Commit 13794a0

Browse files
committed
Fix authentication on Linux for LastFM
Use openExternal to open auth URL in system browser instead of Electron popup
1 parent eae3a4e commit 13794a0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

plugins/LastFM/src/LastFM.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Scrobble } from "./types/Scrobble";
33

44
import type { AnyRecord } from "@inrixia/helpers";
55
import { findModuleProperty, ftch } from "@luna/core";
6-
import { clipboardWriteText } from "@luna/lib.native";
6+
import { openExternal } from "@luna/lib.native";
77
import { storage } from "./Settings";
88
import { hash } from "./hash.native";
99

@@ -79,8 +79,7 @@ export class LastFM {
7979
public static async authenticate() {
8080
const { token } = await LastFM.sendRequest<{ token: string }>("auth.getToken");
8181
const authUrl = `https://www.last.fm/api/auth/?api_key=${this.apiKey}&token=${token}`;
82-
window.open(authUrl, "_blank");
83-
await clipboardWriteText(authUrl);
82+
await openExternal(authUrl);
8483
for (let i = 0; i < 10; i++) {
8584
const session = await this.sendRequest<{ session: LastFmSession }>("auth.getSession", { token }).catch(() => undefined);
8685
if (session !== undefined) return session;

0 commit comments

Comments
 (0)