Skip to content

Commit 7daf476

Browse files
authored
feat: add Instagram integration for clubs (#54)
This pull request handles #28, and includes a minor fix in the `.github/workflows/ci.yaml` file. The changes primarily focus on adding new sections for privacy and terms of use, improving the help documentation, and integrating Instagram functionalities. * **Privacy and Terms of Use Sections:** - Added comprehensive sections detailing the privacy policy and terms of use, including data collection, usage, security, sharing, and user rights. * **Help Documentation:** - Added new help topic: instructions on how to delete a club. * **Instagram Integration:** - Added functionalities for connecting and managing Instagram accounts, including error handling and user interface messages. [[1]](diffhunk://#diff-2b478861aafadc83f0fe12f2c460e7e59a8f14fa61343e81d8e7851076979672L423-R635) [[2]](diffhunk://#diff-2b478861aafadc83f0fe12f2c460e7e59a8f14fa61343e81d8e7851076979672L959-R1174) [[3]](diffhunk://#diff-2b478861aafadc83f0fe12f2c460e7e59a8f14fa61343e81d8e7851076979672L997-R1213) [[4]](diffhunk://#diff-2b478861aafadc83f0fe12f2c460e7e59a8f14fa61343e81d8e7851076979672R1245-R1249) ### Minor Fix: * **CI Workflow:** - Corrected a typo in the `TURNSTILE_SECRET_KEY` environment variable and added new environment variables for Facebook integration. These updates enhance the platform's compliance with privacy regulations, improve user guidance, and expand social media integration capabilities. --------- Signed-off-by: Omar Zunic <contact@omarzunic.com>
1 parent 9b027c2 commit 7daf476

File tree

48 files changed

+3239
-683
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3239
-683
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ jobs:
4040
ONESIGNAL_APP_ID: "mock_onesignal_app_id"
4141
ONESIGNAL_API_KEY: "mock_onesignal_api_key"
4242
ADMIN_WEBHOOK_TOKEN: "mock_admin_webhook_token"
43-
TURNSTILE_SECRET_KEY=: "mock_turnstile_secret_key"
43+
TURNSTILE_SECRET_KEY: "mock_turnstile_secret_key"
44+
FACEBOOK_APP_ID: "mock_facebook_app_id"
45+
FACEBOOK_APP_SECRET: "mock_facebook_app_secret"
4446

4547
# Client variables
4648
NEXT_PUBLIC_CDN_URL: "https://example.com"

messages/bs.json

Lines changed: 225 additions & 4 deletions
Large diffs are not rendered by default.

messages/en.json

Lines changed: 225 additions & 4 deletions
Large diffs are not rendered by default.

next.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ const nextConfig = {
4545
protocol: "https",
4646
hostname: "i.imgur.com",
4747
},
48+
{
49+
protocol: "https",
50+
hostname: "*.cdninstagram.com",
51+
},
52+
{
53+
protocol: "https",
54+
hostname: "*.fbcdn.net",
55+
},
4856
],
4957
},
5058
async redirects() {

prisma/schema/clubs.prisma

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ model Club {
1515
verified Boolean @default(false)
1616
website String?
1717
18+
// Instagram integration fields
19+
instagramUsername String?
20+
instagramProfilePictureUrl String?
21+
instagramAccessToken String?
22+
instagramTokenExpiry DateTime?
23+
instagramRefreshToken String?
24+
instagramConnected Boolean @default(false)
25+
instagramBusinessId String? // Instagram Business Account ID
26+
facebookPageId String? // Connected Facebook Page ID
27+
instagramTokenType String? // Type of token (e.g., "PERMANENT", "TEMPORARY")
28+
1829
events Event[]
1930
rules ClubRule[]
2031
members ClubMembership[]
@@ -94,3 +105,15 @@ model ClubInvite {
94105
@@index([clubId])
95106
@@index([userId])
96107
}
108+
109+
// Temporary storage for Instagram page selection process
110+
model InstagramPageSelection {
111+
id String @id @default(cuid())
112+
clubId String
113+
accessToken String @db.Text
114+
pages String @db.Text // JSON string of pages
115+
expiresAt DateTime
116+
createdAt DateTime @default(now())
117+
118+
@@index([clubId])
119+
}

public/help/delete-club-photo-1.png

20.7 KB
Loading

public/help/delete-club-photo-2.png

18.8 KB
Loading

src/app/[locale]/(auth)/_actions/send-email-verification.action.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export async function sendEmailVerificationAction({
4141

4242
return resp.MessageId;
4343
} catch (error) {
44-
console.error(error);
4544
return null;
4645
}
4746
}

src/app/[locale]/(auth)/login/page.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,6 @@ export default function LoginPage() {
131131
});
132132
}
133133

134-
// Debug the token state to see when it changes
135-
useEffect(() => {
136-
console.log(
137-
"Turnstile token state changed:",
138-
turnstileToken ? "token set" : "no token",
139-
);
140-
}, [turnstileToken]);
141-
142134
return (
143135
<>
144136
<CardHeader>

src/app/[locale]/(auth)/register/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export default function RegisterPage() {
8383
async function onSubmit(data: RegisterFormValues) {
8484
if (!turnstileToken) {
8585
toast.error(t("captchaError"));
86-
console.error("Missing turnstile token on register submit");
8786
return;
8887
}
8988

@@ -115,7 +114,6 @@ export default function RegisterPage() {
115114
router.refresh();
116115
},
117116
onError: (ctx) => {
118-
console.error("Register error:", ctx.error);
119117
if (ctx.error.status === 403) {
120118
toast.error(t("unverified"));
121119
} else {

0 commit comments

Comments
 (0)