Skip to content

Commit 8faa91b

Browse files
authored
Merge pull request #708 from halkeye/add-env-for-mastodon
2 parents 402878c + 8a972c5 commit 8faa91b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ DISCORD_BOT_TOKEN_ID=""
7070
SLACK_ID=""
7171
SLACK_SECRET=""
7272
SLACK_SIGNING_SECRET=""
73+
MASTODON_URL="https://mastodon.social"
7374
MASTODON_CLIENT_ID=""
7475
MASTODON_CLIENT_SECRET=""
7576

libraries/nestjs-libraries/src/integrations/social/mastodon.custom.provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class MastodonCustomProvider extends MastodonProvider {
7474
return this.dynamicPost(
7575
id,
7676
accessToken,
77-
'https://mastodon.social',
77+
process.env.MASTODON_URL || 'https://mastodon.social',
7878
postDetails
7979
);
8080
}

libraries/nestjs-libraries/src/integrations/social/mastodon.provider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class MastodonProvider extends SocialAbstract implements SocialProvider {
3939
async generateAuthUrl() {
4040
const state = makeId(6);
4141
const url = this.generateUrlDynamic(
42-
'https://mastodon.social',
42+
process.env.MASTODON_URL || 'https://mastodon.social',
4343
state,
4444
process.env.MASTODON_CLIENT_ID!,
4545
process.env.FRONTEND_URL!
@@ -102,7 +102,7 @@ export class MastodonProvider extends SocialAbstract implements SocialProvider {
102102
return this.dynamicAuthenticate(
103103
process.env.MASTODON_CLIENT_ID!,
104104
process.env.MASTODON_CLIENT_SECRET!,
105-
'https://mastodon.social',
105+
process.env.MASTODON_URL || 'https://mastodon.social',
106106
params.code
107107
);
108108
}
@@ -179,7 +179,7 @@ export class MastodonProvider extends SocialAbstract implements SocialProvider {
179179
return this.dynamicPost(
180180
id,
181181
accessToken,
182-
'https://mastodon.social',
182+
process.env.MASTODON_URL || 'https://mastodon.social',
183183
postDetails
184184
);
185185
}

0 commit comments

Comments
 (0)