Skip to content

Commit cb274d2

Browse files
committed
Merge pull request #1695 from ActiveLearningStudio/feature/msteams-integration
Tenant fixes
1 parent b42e7da commit cb274d2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/containers/LMS/MsTeams/MsTeamsActivityContainer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function MsTeamsActivityContainer({ match, history }) {
121121
const params = new URLSearchParams();
122122
params.append('client_id', config.teamsClientId);
123123
params.append('response_type', 'code');
124-
params.append('scope', 'offline_access user.read mail.read');
124+
params.append('scope', 'offline_access user.read');
125125
params.append('redirect_uri', `https://${window.location.hostname}/msteams/callback`);
126126
params.append('state', window.location.href);
127127
url.search = params.toString();

src/containers/MsTeams/callback.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ const MsTeamsCallBack = () => {
1313
const params = new URLSearchParams(useLocation().search);
1414
const code = params.get('code');
1515
const state = params.get('state');
16+
const tenantId = state.split('msteam/')[1].split('/launch')[0];
1617
const [error, setError] = useState(null);
1718

1819
// Get app context and auth token
1920
useEffect(() => {
20-
MsTeamsService.msTeamsToken(code)
21+
MsTeamsService.msTeamsToken(code, tenantId)
2122
.then((response) => {
2223
localStorage.setItem('msteams_token', response.access_token);
2324
localStorage.setItem('msteams_refresh_token', response.refresh_token);

src/services/msTeams.service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import config from 'config';
33
import httpService from './http.service';
44
const { apiVersion } = config;
55

6-
const msTeamsToken = (code) => httpService
6+
const msTeamsToken = (code, tenantId) => httpService
77
.get(`/microsoft-team/get-access-token-via-code`,
88
{},
99
{
1010
code: code,
11+
tenantId: tenantId,
1112
})
1213
.then(({ data }) => data)
1314
.catch((err) => Promise.reject(err.response.data));

0 commit comments

Comments
 (0)