|
@@ -3,6 +3,7 @@ const emailField = AccountsTemplates.removeField('email');
|
|
let disableRegistration = false;
|
|
let disableRegistration = false;
|
|
let disableForgotPassword = false;
|
|
let disableForgotPassword = false;
|
|
let passwordLoginDisabled = false;
|
|
let passwordLoginDisabled = false;
|
|
|
|
+let oidcEnabled = false;
|
|
|
|
|
|
Meteor.call('isPasswordLoginDisabled', (_, result) => {
|
|
Meteor.call('isPasswordLoginDisabled', (_, result) => {
|
|
if (result) {
|
|
if (result) {
|
|
@@ -11,6 +12,16 @@ Meteor.call('isPasswordLoginDisabled', (_, result) => {
|
|
//console.log(result);
|
|
//console.log(result);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+Meteor.call('getOauthServerUrl', (_, result) => {
|
|
|
|
+ if (result) {
|
|
|
|
+ oauthServerUrl = result;
|
|
|
|
+ const a = document.createElement("a");
|
|
|
|
+ a.href = oauthServerUrl;
|
|
|
|
+ const baseUrl = `${a.protocol}//${a.hostname}`;
|
|
|
|
+ console.log(baseUrl);
|
|
|
|
+ }
|
|
|
|
+ else oauthServerUrl = "home";
|
|
|
|
+});
|
|
|
|
|
|
Meteor.call('isDisableRegistration', (_, result) => {
|
|
Meteor.call('isDisableRegistration', (_, result) => {
|
|
if (result) {
|
|
if (result) {
|
|
@@ -19,7 +30,9 @@ Meteor.call('isDisableRegistration', (_, result) => {
|
|
//console.log(result);
|
|
//console.log(result);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+Meteor.call('isOidcRedirectionEnabled', (_, result) => {
|
|
|
|
+ oidcEnabled = result ? true : false;
|
|
|
|
+});
|
|
Meteor.call('isDisableForgotPassword', (_, result) => {
|
|
Meteor.call('isDisableForgotPassword', (_, result) => {
|
|
if (result) {
|
|
if (result) {
|
|
disableForgotPassword = true;
|
|
disableForgotPassword = true;
|
|
@@ -57,6 +70,12 @@ AccountsTemplates.configure({
|
|
showForgotPasswordLink: !disableForgotPassword,
|
|
showForgotPasswordLink: !disableForgotPassword,
|
|
forbidClientAccountCreation: disableRegistration,
|
|
forbidClientAccountCreation: disableRegistration,
|
|
onLogoutHook() {
|
|
onLogoutHook() {
|
|
|
|
+ if(oidcEnabled && oauthServerUrl!=="home")
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ oidcEnabled = !oidcEnabled;
|
|
|
|
+ window.location.href = oauthServerUrl + "/if/user/#/library";
|
|
|
|
+ }
|
|
const homePage = 'home';
|
|
const homePage = 'home';
|
|
if (FlowRouter.getRouteName() === homePage) {
|
|
if (FlowRouter.getRouteName() === homePage) {
|
|
FlowRouter.reload();
|
|
FlowRouter.reload();
|