Skip to content

Commit d9cbd76

Browse files
Merge pull request #287 from sharifrahaman/blank-page
Blank redirect URI to avoid Single Page App registration for each test app deployment
2 parents cd02e74 + d0cea23 commit d9cbd76

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Project/src/Utils/Utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ export const utils = {
9494
return response.data;
9595
}
9696
const authConfig = await fetchAuthConfig();
97+
const redirectUri = `${window.location.origin}/blank`;
9798

9899
const oAuthObj = new PublicClientApplication(authConfig.configuration);
99-
const popupLoginResponse = await oAuthObj.loginPopup({scopes: authConfig.scopes.popUpLogin});
100+
const popupLoginResponse = await oAuthObj.loginPopup({scopes: authConfig.scopes.popUpLogin, redirectUri});
100101
const response = await axios({
101102
url: 'teamsPopupLogin',
102103
method: 'POST',
@@ -149,9 +150,10 @@ export const utils = {
149150
return response.data;
150151
}
151152
const entraCredentialConfig = await fetchEntraConfig();
153+
const redirectUri = `${window.location.origin}/blank`;
152154

153155
const tokenCredential = new InteractiveBrowserCredential({
154-
redirectUri: window.location.href, // e.g., 'http://localhost:3000'
156+
redirectUri, // e.g., 'http://localhost:3000'
155157
...entraCredentialConfig
156158
});
157159
const credential = new AzureCommunicationTokenCredential({

Project/webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ module.exports = {
254254
res.sendStatus(400);
255255
}
256256
});
257+
devServer.app.get('/blank', async (req, res) => {
258+
res.status(200).send('');
259+
});
257260
devServer.app.post('/createRoom', async (req, res) => {
258261
try {
259262
let participants = [];

0 commit comments

Comments
 (0)