diff --git a/src/api/teamsbotApi.ts b/src/api/teamsbotApi.ts index c99a38f..e9f4595 100644 --- a/src/api/teamsbotApi.ts +++ b/src/api/teamsbotApi.ts @@ -324,8 +324,11 @@ export async function fetchVoices(languageCode: string): Promise * receive the /v2/ (authenticated) vs light-meetings (anonymous) page. * Does NOT join the meeting. */ -export async function testAuth(instanceId: string, meetingUrl: string): Promise { - const response = await api.post(`/api/teamsbot/${instanceId}/test-auth`, { meetingUrl }, { +export async function testAuth(instanceId: string, meetingUrl: string, botEmail?: string, botPassword?: string): Promise { + const payload: Record = { meetingUrl }; + if (botEmail) payload.botEmail = botEmail; + if (botPassword) payload.botPassword = botPassword; + const response = await api.post(`/api/teamsbot/${instanceId}/test-auth`, payload, { timeout: 300000, // 5 minutes — tests run sequentially }); return response.data; diff --git a/src/pages/views/teamsbot/TeamsbotSettingsView.tsx b/src/pages/views/teamsbot/TeamsbotSettingsView.tsx index 390ef3c..b9be507 100644 --- a/src/pages/views/teamsbot/TeamsbotSettingsView.tsx +++ b/src/pages/views/teamsbot/TeamsbotSettingsView.tsx @@ -39,6 +39,8 @@ export const TeamsbotSettingsView: React.FC = () => { // Auth detection test state const [testMeetingUrl, setTestMeetingUrl] = useState(''); + const [testBotEmail, setTestBotEmail] = useState(''); + const [testBotPassword, setTestBotPassword] = useState(''); const [testRunning, setTestRunning] = useState(false); const [testResults, setTestResults] = useState(null); const [testError, setTestError] = useState(null); @@ -157,7 +159,12 @@ export const TeamsbotSettingsView: React.FC = () => { setTestError(null); try { - const results = await teamsbotApi.testAuth(instanceId, testMeetingUrl.trim()); + const results = await teamsbotApi.testAuth( + instanceId, + testMeetingUrl.trim(), + testBotEmail.trim() || undefined, + testBotPassword || undefined, + ); setTestResults(results); } catch (err: any) { setTestError(err.message || 'Auth-Test fehlgeschlagen'); @@ -253,6 +260,30 @@ export const TeamsbotSettingsView: React.FC = () => { +
+ setTestBotEmail(e.target.value)} + placeholder="Bot-Email (z.B. nyla.larsson@poweron.swiss)" + disabled={testRunning} + style={{ flex: 1 }} + /> + setTestBotPassword(e.target.value)} + placeholder="Bot-Passwort" + disabled={testRunning} + style={{ flex: 1 }} + /> +
+ + Optional: Bot-Credentials fuer Auth-Test. Werden beim ersten Test automatisch in der DB gespeichert. + + {testRunning && (