Skip to content

Commit b7c0ae7

Browse files
committed
Fix theme config, and made redirect URI instructions consistent
1 parent 1f940f2 commit b7c0ae7

File tree

15 files changed

+77
-33
lines changed

15 files changed

+77
-33
lines changed

components/snippets/oauth2redirect.mdx

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type { ReactElement } from 'react';
2+
3+
type OAuth2RedirectProps = {
4+
provider?: string
5+
}
6+
7+
export default function OAuth2Redirect({
8+
provider,
9+
}: OAuth2RedirectProps): ReactElement {
10+
return <div>
11+
<br />
12+
<p>
13+
The OAuth2 Redirect URI is the location where the provider will redirect to after trying to login. This needs to set to your Postiz <code className = "nextra-code">FRONTEND_URL</code> + <code className = "nextra-code">/integrations/social/</code> + <code className = "nextra-code">{provider}</code>.
14+
</p>
15+
16+
<ul className = "[:is(ol,ul)_&]:_my-3 [&:not(:first-child)]:_mt-6 _list-disc ltr:_ml-6 rtl:_mr-6">
17+
<li>eg: If you are running on a container, and your Postiz URL is: <code className = "nextra-code">https://postiz.example.com</code>, then your OAuth2 Redirect URI is <code className = "nextra-code">https://postiz.example.com/integrations/social/{provider}</code></li>
18+
<li>eg: If you are running on localhost, and your Postiz URL is <code className = "nextra-code">http://localhost:4200</code>, then your OAuth2 Redirect URI is <code className = "nextra-code">http://localhost:4200/integrations/social/{provider}</code></li>
19+
</ul>
20+
21+
<br />
22+
23+
<p>
24+
You only need to set one OAuth2 Redirect URI when you are setting up your Postiz app.
25+
</p>
26+
</div>;
27+
}

pages/providers/discord.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: How to add discord to your system
44
---
55

66
import {Steps, Callout} from "nextra/components";
7-
import OAuth2Redirect from "../../components/snippets/oauth2redirect.mdx";
7+
import OAuth2Redirect from "../../components/snippets/oauth2redirect.tsx";
88

99
<Callout>
1010
This integration requires that you have **Manage Server** permissions on the Discord server you want to integrate with.
@@ -30,7 +30,7 @@ DISCORD_CLIENT_SECRET="your_client_secret"
3030

3131
### Add a Redirect URI
3232

33-
<OAuth2Redirect />
33+
<OAuth2Redirect provider = "discord" />
3434

3535
The redirect URI is the URL that Discord will redirect to after you have logged in. Assuming you are running Postiz on `postiz.example.com`, this would be: `https://postiz.example.com/integrations/social/discord`. Alternatively if you are running on `localhost:4200`, this would be `http://localhost:4200/integrations/social/discord`. You only really need one of these, depending on where you are running Postiz.
3636

pages/providers/dribbble.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: How to add Dribbble to your system
44
---
55

66
import {Steps, Callout} from "nextra/components";
7+
import OAuth2Redirect from "../../components/snippets/oauth2redirect.tsx";
78

89
<Steps>
910

@@ -14,7 +15,9 @@ import {Steps, Callout} from "nextra/components";
1415
* **Name:** `MyPostizInstance`
1516
* **Description:** `My Postiz Instance`
1617
* **Website:** `https://example.com`
17-
* **Redirect URI:** `http://localhost:4200/integrations/social/dribbble`
18+
* **Redirect URI:** (see below)
19+
20+
<OAuth2Redirect provider = "dribble" />
1821

1922
### Copy your client secret to environment variables
2023

pages/providers/facebook.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: How to add Facebook to your system
44
---
55

66
import {Steps, Callout} from "nextra/components";
7+
import OAuth2Redirect from "../../components/snippets/oauth2redirect.tsx";
78

89
<Callout type="warning">
910
**NOTE:** Please be advised that Instagram and Facebook can use the same app (no need to create two separate apps)
@@ -42,7 +43,7 @@ Set up login for business
4243
Set up a redirect URI back to the application
4344
![step 6](https://github.com/user-attachments/assets/8bf1774b-b6fe-4ac6-aea5-97d8c8bbf5da)
4445

45-
The default dev container redirect URI is `http://localhost:4200/integrations/social/facebook`
46+
<OAuth2Redirect provider = "facebook" />
4647

4748
### Step 7
4849
![step 7](https://github.com/user-attachments/assets/a81aa2a3-de66-4099-906b-b78c641d1a23)
@@ -66,4 +67,4 @@ FACEBOOK_APP_SECRET="app secret"
6667
```
6768

6869
Facebook should now be working!
69-
</Steps>
70+
</Steps>

pages/providers/instagram.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: How to add Instagram to your system
44
---
55

66
import {Steps, Callout} from "nextra/components";
7+
import OAuth2Redirect from "../../components/snippets/oauth2redirect.tsx";
78

89
<Callout type="warning">
910
**NOTE:** Please be advised that Instagram and Facebook can use the same app (no need to create two separate apps)
@@ -42,7 +43,7 @@ Set up login for business
4243
Set up a redirect URI back to the application
4344
![Instagram](https://github.com/user-attachments/assets/78496d3f-3b84-4724-afc8-ed217d892c6d)
4445

45-
The default dev container redirect URI is `http://localhost:4200/integrations/social/instagram`
46+
<OAuth2Redirect provider = "instagram" />
4647

4748
### Step 7
4849
![step 7](https://github.com/user-attachments/assets/a81aa2a3-de66-4099-906b-b78c641d1a23)
@@ -67,4 +68,4 @@ INSTAGRAM_APP_SECRET="app secret"
6768
```
6869

6970
Instagram should now be working!
70-
</Steps>
71+
</Steps>

pages/providers/linkedin.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: Linkedin
33
description: How to add Linkedin to your system
44
---
55

6+
import OAuth2Redirect from "../../components/snippets/oauth2redirect.tsx";
7+
68
Head over to [Linkedin developers](https://www.linkedin.com/developers/apps) and create a new app.
79
![Linkedin](/images/providers/linkedin/linkedin-001.png)
810

@@ -11,9 +13,9 @@ Fill in all the details, once created head over to Products and make sure you ad
1113

1214
It is important to request the Advertising API permissions and fill up the request form, or you will not have the ability to refresh your tokens.
1315

14-
Make sure your redirect URL is set to `http://localhost:4200/integrations/social/linkedin` for local development.
16+
<OAuth2Redirect provider = "linkedin" />
1517

16-
For production environments set the URL redirection to 'https://YOURDOMAIN/integrations/social/linkedin' or 'https://YOURDOMAIN/integrations/social/linkedin-page'
18+
If you are using the "LinkedIN Page" provider, then the redirect url should be "linkedin-page".
1719

1820
Copy the created `Client ID` and `Client Secret` and add them to your `.env` file.
1921

pages/providers/mastodon.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: How to add Mastodon to your system
44
---
55

66
import {Steps, Callout} from "nextra/components";
7+
import OAuth2Redirect from "../../components/snippets/oauth2redirect.tsx";
78

89
<Callout type="warning">
910
**NOTE:** Postiz is currently hard-coded to use mastodon.social only. This will become more flexible to support other servers in a future release.
@@ -13,6 +14,8 @@ Mastodon client registration is not done via ther web interface, but by talking
1314

1415
Optionally check that you have `jq` installed on your system. You can normally install this with brew, apt-get, yum or chocolatey. If you don't have `jq` installed, you can remove it from the command below.
1516

17+
<OAuth2Redirect provider = "mastodon" />
18+
1619
Run the following curl command in a terminal to get the Mastodon client id and client secret.
1720

1821
```bash

pages/providers/pinterest.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: How to add Pinterest to your system
44
---
55

66
import {Steps, Callout} from "nextra/components";
7+
import OAuth2Redirect from "../../components/snippets/oauth2redirect.tsx";
78

89
<Callout>
910
This integration requires that you have a Pinterest Company Account.
@@ -19,7 +20,8 @@ Copy the App ID at "App id" and the Secret Key at "App secret key"
1920
[Copy App ID and Secret](https://github.com/egelhaus/postiz-docs/blob/cfd39114ef6d44da864717b23d704f6265cefa84/public/images/providers/pinterest/pinterest-002.png)
2021

2122
### Step 3 Configure Redirect URI
22-
Add your Redirect URI at "Redirect URIs" with the default URI "http://localhost:4200/integrations/social/pinterest
23+
24+
<OAuth2Redirect provider = "pinterest" />
2325
[Setup of Redirect URIs](https://github.com/egelhaus/postiz-docs/blob/d11ea333ad8d70c5dee7ac0ad76283ded514219b/public/images/providers/pinterest/pinterest-001.png)
2426

2527
</Steps>
@@ -29,4 +31,4 @@ PINTEREST_CLIENT_ID=""
2931
PINTEREST_CLIENT_SECRET=""
3032
```
3133

32-
You should now be able to add the Pinterest Provider to your User / Team Account.
34+
You should now be able to add the Pinterest Provider to your User / Team Account.

pages/providers/reddit.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ title: Reddit
33
description: How to add Reddit to your system
44
---
55

6+
import OAuth2Redirect from "../../components/snippets/oauth2redirect.tsx";
7+
68
Head over to [Reddit developers](https://www.reddit.com/prefs/apps) and create a new app.
7-
In the type of app, select `web app` and in the redirect uri, add `http://localhost:4200/integrations/social/reddit`.
9+
In the type of app, select `web app` and in the redirect uri, add your redirect URI.
10+
11+
<OAuth2Redirect provider = "reddit" />
812

913
Copy the Reddit client id and client secret and add them to your `.env` file.
1014

@@ -13,4 +17,4 @@ Copy the Reddit client id and client secret and add them to your `.env` file.
1317
```env
1418
REDDIT_CLIENT_ID=""
1519
REDDIT_CLIENT_SECRET=""
16-
```
20+
```

0 commit comments

Comments
 (0)