Skip to content

Commit 711851e

Browse files
committed
fix: DeepL API authorization
1 parent d622382 commit 711851e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/api.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '../types/global'
66

77
export class Api {
8-
constructor(private provider: validProvider | null, private token: string) { }
8+
constructor(private provider: validProvider | null, private token: string) {}
99

1010
private get baseUrl(): string {
1111
switch (this.provider) {
@@ -23,7 +23,6 @@ export class Api {
2323
try {
2424
const body: Record<string, any> = {
2525
...requestObject.body,
26-
auth_key: this.token,
2726
}
2827
const url = `${this.baseUrl}${requestObject.url}`
2928

@@ -32,7 +31,7 @@ export class Api {
3231
url,
3332
header: {
3433
'Content-Type': 'application/x-www-form-urlencoded',
35-
'User-Agent': 'a-translator-bob/' + process.env.__VERSION__,
34+
Authorization: `DeepL-Auth-Key ${this.token}`,
3635
},
3736
body,
3837
})

0 commit comments

Comments
 (0)