mirror of
https://github.com/p-stream/backend.git
synced 2026-03-11 17:55:35 +00:00
make trakt client id optional
This commit is contained in:
parent
eb2cb15c43
commit
ec8a973c2e
1 changed files with 8 additions and 8 deletions
|
|
@ -1,14 +1,14 @@
|
|||
import Trakt from 'trakt.tv';
|
||||
const traktKeys = useRuntimeConfig().trakt;
|
||||
|
||||
if (!traktKeys) {
|
||||
throw new Error('Missing TraktKeys info ERROR: ' + JSON.stringify(traktKeys));
|
||||
let trakt: Trakt | null = null;
|
||||
|
||||
if (traktKeys?.clientId && traktKeys?.clientSecret) {
|
||||
const options = {
|
||||
client_id: traktKeys.clientId,
|
||||
client_secret: traktKeys.clientSecret,
|
||||
};
|
||||
trakt = new Trakt(options);
|
||||
}
|
||||
|
||||
const options = {
|
||||
client_id: traktKeys.clientId,
|
||||
client_secret: traktKeys.clientSecret,
|
||||
};
|
||||
|
||||
const trakt = new Trakt(options);
|
||||
export default trakt;
|
||||
|
|
|
|||
Loading…
Reference in a new issue