Skip to content

Commit 083dd7f

Browse files
committed
update
1 parent 0b75ea6 commit 083dd7f

3 files changed

Lines changed: 3 additions & 52 deletions

File tree

examples/slack-connect-example/.env.sample

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,4 @@ NEXT_PUBLIC_SLACK_CLIENT_ID=<slack client id>
2121
NEXT_PUBLIC_KNOCK_SLACK_CHANNEL_ID=<knock slack channel id>
2222
NEXT_PUBLIC_REDIRECT_URL=http://localhost:3000/
2323

24-
# MS Teams configuration (optional — enables side-by-side testing with Slack)
25-
NEXT_PUBLIC_GRAPH_API_CLIENT_ID=<graph api client id>
26-
NEXT_PUBLIC_KNOCK_MS_TEAMS_CHANNEL_ID=<knock ms teams channel id>
27-
2824
NEXT_PUBLIC_KNOCK_BRANCH=<optional>

examples/slack-connect-example/pages/api/set_token.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ export default async function handler(
1414

1515
const { tenant, user, slackChannelsRecipientObject } = req.body;
1616
try {
17-
const rawKey = process.env.KNOCK_SIGNING_KEY!;
18-
const signingKey = rawKey.startsWith("LS0t")
19-
? Buffer.from(rawKey, "base64").toString("utf-8")
20-
: rawKey;
17+
const signingKey = process.env.KNOCK_SIGNING_KEY!;
2118

2219
// JWT NumericDates specified in seconds:
2320
const currentTime = Math.floor(Date.now() / 1000);
@@ -33,7 +30,6 @@ export default async function handler(
3330
grants: {
3431
[`https://api.knock.app/v1/objects/$tenants/${tenant}`]: {
3532
"slack/channels_read": [{}],
36-
"ms_teams/channels_read": [{}],
3733
},
3834
[`https://api.knock.app/v1/objects/${slackChannelsRecipientObject.collection}/${slackChannelsRecipientObject.objectId}`]:
3935
{

examples/slack-connect-example/pages/index.tsx

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import {
2-
KnockMsTeamsProvider,
32
KnockProvider,
43
KnockSlackProvider,
5-
MsTeamsAuthButton,
64
SlackAuthButton,
75
SlackAuthContainer,
86
SlackChannelCombobox,
@@ -28,14 +26,10 @@ export default function Home() {
2826
collection: process.env.NEXT_PUBLIC_CONNECTIONS_COLLECTION!,
2927
};
3028

31-
const onSlackAuthComplete = (result: string) => {
29+
const onAuthComplete = (result: string) => {
3230
console.log("Result from Slack authentication:", result);
3331
};
3432

35-
const onTeamsAuthComplete = (result: string) => {
36-
console.log("Result from MS Teams authentication:", result);
37-
};
38-
3933
const { isLoading, isError } = useSetToken({
4034
tenant,
4135
user,
@@ -120,7 +114,7 @@ export default function Home() {
120114
<SlackAuthButton
121115
slackClientId={process.env.NEXT_PUBLIC_SLACK_CLIENT_ID!}
122116
redirectUrl={redirectUrl}
123-
onAuthenticationComplete={onSlackAuthComplete}
117+
onAuthenticationComplete={onAuthComplete}
124118
additionalScopes={["users:read", "users:read.email"]}
125119
/>
126120
</div>
@@ -152,41 +146,6 @@ export default function Home() {
152146
</div>
153147
</>
154148
</KnockSlackProvider>
155-
156-
{/* MS Teams provider rendered as sibling to reproduce KNO-13032 */}
157-
{process.env.NEXT_PUBLIC_KNOCK_MS_TEAMS_CHANNEL_ID && (
158-
<KnockMsTeamsProvider
159-
knockMsTeamsChannelId={
160-
process.env.NEXT_PUBLIC_KNOCK_MS_TEAMS_CHANNEL_ID
161-
}
162-
tenantId={tenant}
163-
>
164-
<div
165-
style={{
166-
marginTop: "60px",
167-
borderTop: "2px solid #eee",
168-
paddingTop: "20px",
169-
}}
170-
>
171-
<div
172-
style={{
173-
marginBottom: "20px",
174-
fontFamily: "monospace",
175-
fontSize: "40px",
176-
}}
177-
>
178-
MS Teams connector
179-
</div>
180-
<div style={{ margin: "10px", padding: "10px" }}>
181-
<MsTeamsAuthButton
182-
graphApiClientId={process.env.NEXT_PUBLIC_GRAPH_API_CLIENT_ID!}
183-
redirectUrl={redirectUrl}
184-
onAuthenticationComplete={onTeamsAuthComplete}
185-
/>
186-
</div>
187-
</div>
188-
</KnockMsTeamsProvider>
189-
)}
190149
</KnockProvider>
191150
);
192151
}

0 commit comments

Comments
 (0)