Skip to content

Commit

Permalink
Fix propper LTIAuthentication like in PR 826
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrahn committed Nov 3, 2023
1 parent c6dc43c commit ca2e6ee
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions vueapp/store/opencast.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,20 @@ const actions = {
return ApiService.put('courses/' + data.cid + '/upload/' + data.upload);
},

checkLTIAuthentication({ commit }, server)
async checkLTIAuthentication({ commit }, server)
{
axios({
method: 'GET',
url: server.name + "/lti/info.json",
crossDomain: true,
withCredentials: true,
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
}).then((response) => {
if (response.status == 200) {
try {
const response = await axios({
method: 'GET',
url: server.name + "/lti/info.json",
crossDomain: true,
withCredentials: true,
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
});

if (response.status === 200) {
commit('setLTIStatus', {
server: server.id,
authenticated: true
Expand All @@ -155,7 +157,12 @@ const actions = {
authenticated: false
});
}
});
} catch (error) {
commit('setLTIStatus', {
server: server.id,
authenticated: false
});
}
}
}

Expand Down

0 comments on commit ca2e6ee

Please sign in to comment.