@@ -7,8 +7,8 @@ const axios = require("axios");
77const bodyParser = require ( 'body-parser' ) ;
88const msal = require ( '@azure/msal-node' ) ;
99
10- const { authConfig, authScopes , entraCredentialConfig} = require ( './oAuthConfig' ) ;
11- const clientId = authConfig . auth . clientId ;
10+ const { authConfig, entraCredentialConfig} = require ( './oAuthConfig' ) ;
11+ const clientId = authConfig . configuration . auth . clientId ;
1212
1313
1414if ( ! config || ! config . connectionString || config . connectionString . indexOf ( 'endpoint=' ) === - 1 )
@@ -216,11 +216,7 @@ module.exports = {
216216 devServer . app . get ( '/entraConfig' , async ( req , res ) => {
217217 try {
218218 res . setHeader ( 'Content-Type' , 'application/json' ) ;
219- res . status ( 200 ) . json ( {
220- tenantId : entraCredentialConfig . tenantId ,
221- clientId : entraCredentialConfig . clientId ,
222- resourceEndpoint : entraCredentialConfig . resourceEndpoint
223- } ) ;
219+ res . status ( 200 ) . json ( entraCredentialConfig ) ;
224220 } catch ( e ) {
225221 console . error ( e ) ;
226222 res . sendStatus ( 400 ) ;
@@ -231,8 +227,8 @@ module.exports = {
231227 const email = req . body . email ;
232228 const password = req . body . password ;
233229
234- const pca = new msal . PublicClientApplication ( authConfig ) ;
235- let tokenRequest = { scopes : authScopes . m365Login }
230+ const pca = new msal . PublicClientApplication ( authConfig . configuration ) ;
231+ let tokenRequest = { scopes : authConfig . scopes . m365Login }
236232
237233 tokenRequest . username = email ;
238234 tokenRequest . password = password ;
@@ -249,6 +245,15 @@ module.exports = {
249245 res . sendStatus ( 400 ) ;
250246 }
251247 } ) ;
248+ devServer . app . get ( '/authConfig' , async ( req , res ) => {
249+ try {
250+ res . setHeader ( 'Content-Type' , 'application/json' ) ;
251+ res . status ( 200 ) . json ( authConfig ) ;
252+ } catch ( e ) {
253+ console . error ( e ) ;
254+ res . sendStatus ( 400 ) ;
255+ }
256+ } ) ;
252257 devServer . app . post ( '/createRoom' , async ( req , res ) => {
253258 try {
254259 let participants = [ ] ;
0 commit comments