mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00

Thanks to wb9688 and xet7 ! Fixes #4660, related https://github.com/wekan/wekan/pull/4588
22 lines
787 B
JavaScript
22 lines
787 B
JavaScript
Accounts.oauth.registerService('oidc');
|
|
|
|
if (Meteor.isClient) {
|
|
Meteor.loginWithOidc = function(options, callback) {
|
|
// support a callback without options
|
|
if (! callback && typeof options === "function") {
|
|
callback = options;
|
|
options = null;
|
|
}
|
|
|
|
var credentialRequestCompleteCallback = Accounts.oauth.credentialRequestCompleteHandler(callback);
|
|
Oidc.requestCredential(options, credentialRequestCompleteCallback);
|
|
};
|
|
} else {
|
|
Accounts.addAutopublishFields({
|
|
// not sure whether the OIDC api can be used from the browser,
|
|
// thus not sure if we should be sending access tokens; but we do it
|
|
// for all other oauth2 providers, and it may come in handy.
|
|
forLoggedInUser: ['services.oidc'],
|
|
forOtherUsers: ['services.oidc.id']
|
|
});
|
|
}
|