feat(openid-connect): Switch to generic OIDC Client library instead of using Keycloak.js (#273)
This commit is contained in:
1 parent
2f05ed5961
commit
18bcf83805
70 files changed
+572
-655
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { cornerstoneWADOImageLoader } from 'meteor/ohif:cornerstone';
|
||||
import { Accounts } from "meteor/accounts-base";
|
||||
|
||||
Meteor.startup(function() {
|
||||
const maxWebWorkers = Math.max(navigator.hardwareConcurrency - 1, 1);
|
||||
@@ -23,17 +22,10 @@ Meteor.startup(function() {
|
||||
|
||||
cornerstoneWADOImageLoader.configure({
|
||||
beforeSend: function(xhr) {
|
||||
const userId = Meteor.userId();
|
||||
const accessToken = OHIF.user.getAccessToken();
|
||||
|
||||
if (accessToken) {
|
||||
xhr.setRequestHeader("Authorization", `Bearer ${accessToken}`);
|
||||
} else {
|
||||
const loginToken = Accounts._storedLoginToken();
|
||||
if (userId && loginToken) {
|
||||
xhr.setRequestHeader("x-user-id", userId);
|
||||
xhr.setRequestHeader("x-auth-token", loginToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user