Added back autologin, because reverting it broke Google OIDC login.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2022-09-01 12:12:30 +03:00
parent ba1d04b99f
commit 1e4fba3ec8
5 changed files with 93 additions and 34 deletions

View file

@ -229,6 +229,12 @@ if (Meteor.isServer) {
]);
}
function loadOidcConfig(service){
check(service, String);
var config = ServiceConfiguration.configurations.findOne({service: service});
return config;
}
function sendInvitationEmail(_id) {
const icode = InvitationCodes.findOne(_id);
const author = Users.findOne(Meteor.userId());
@ -495,6 +501,12 @@ if (Meteor.isServer) {
};
},
getOauthServerUrl(){
return process.env.OAUTH2_SERVER_URL;
},
getOauthDashboardUrl(){
return process.env.DASHBOARD_URL;
},
getDefaultAuthenticationMethod() {
return process.env.DEFAULT_AUTHENTICATION_METHOD;
},
@ -502,6 +514,12 @@ if (Meteor.isServer) {
isPasswordLoginDisabled() {
return process.env.PASSWORD_LOGIN_ENABLED === 'false';
},
isOidcRedirectionEnabled(){
return process.env.OIDC_REDIRECTION_ENABLED === 'true' && Object.keys(loadOidcConfig("oidc")).length > 0;
},
getServiceConfiguration(service){
return loadOidcConfig(service);
}
});
}