11import {
2+ KnockMsTeamsProvider ,
23 KnockProvider ,
34 KnockSlackProvider ,
5+ MsTeamsAuthButton ,
46 SlackAuthButton ,
57 SlackAuthContainer ,
68 SlackChannelCombobox ,
@@ -26,10 +28,14 @@ export default function Home() {
2628 collection : process . env . NEXT_PUBLIC_CONNECTIONS_COLLECTION ! ,
2729 } ;
2830
29- const onAuthComplete = ( result : string ) => {
31+ const onSlackAuthComplete = ( result : string ) => {
3032 console . log ( "Result from Slack authentication:" , result ) ;
3133 } ;
3234
35+ const onTeamsAuthComplete = ( result : string ) => {
36+ console . log ( "Result from MS Teams authentication:" , result ) ;
37+ } ;
38+
3339 const { isLoading, isError } = useSetToken ( {
3440 tenant,
3541 user,
@@ -114,7 +120,7 @@ export default function Home() {
114120 < SlackAuthButton
115121 slackClientId = { process . env . NEXT_PUBLIC_SLACK_CLIENT_ID ! }
116122 redirectUrl = { redirectUrl }
117- onAuthenticationComplete = { onAuthComplete }
123+ onAuthenticationComplete = { onSlackAuthComplete }
118124 additionalScopes = { [ "users:read" , "users:read.email" ] }
119125 />
120126 </ div >
@@ -146,6 +152,43 @@ export default function Home() {
146152 </ div >
147153 </ >
148154 </ 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 = {
183+ process . env . NEXT_PUBLIC_GRAPH_API_CLIENT_ID !
184+ }
185+ redirectUrl = { redirectUrl }
186+ onAuthenticationComplete = { onTeamsAuthComplete }
187+ />
188+ </ div >
189+ </ div >
190+ </ KnockMsTeamsProvider >
191+ ) }
149192 </ KnockProvider >
150193 ) ;
151194}
0 commit comments