mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Added back autologin, because reverting it broke Google OIDC login.
Thanks to xet7 !
This commit is contained in:
parent
ba1d04b99f
commit
1e4fba3ec8
5 changed files with 93 additions and 34 deletions
|
@ -5,6 +5,16 @@ const emailField = AccountsTemplates.removeField('email');
|
|||
let disableRegistration = false;
|
||||
let disableForgotPassword = false;
|
||||
let passwordLoginDisabled = false;
|
||||
let oidcRedirectionEnabled = false;
|
||||
let oauthServerUrl = "home";
|
||||
let oauthDashboardUrl = "";
|
||||
|
||||
Meteor.call('isOidcRedirectionEnabled', (_, result) => {
|
||||
if(result)
|
||||
{
|
||||
oidcRedirectionEnabled = true;
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.call('isPasswordLoginDisabled', (_, result) => {
|
||||
if (result) {
|
||||
|
@ -14,6 +24,18 @@ Meteor.call('isPasswordLoginDisabled', (_, result) => {
|
|||
}
|
||||
});
|
||||
|
||||
Meteor.call('getOauthServerUrl', (_, result) => {
|
||||
if (result) {
|
||||
oauthServerUrl = result;
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.call('getOauthDashboardUrl', (_, result) => {
|
||||
if (result) {
|
||||
oauthDashboardUrl = result;
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.call('isDisableRegistration', (_, result) => {
|
||||
if (result) {
|
||||
disableRegistration = true;
|
||||
|
@ -59,11 +81,19 @@ AccountsTemplates.configure({
|
|||
showForgotPasswordLink: !disableForgotPassword,
|
||||
forbidClientAccountCreation: disableRegistration,
|
||||
onLogoutHook() {
|
||||
const homePage = 'home';
|
||||
if (FlowRouter.getRouteName() === homePage) {
|
||||
FlowRouter.reload();
|
||||
} else {
|
||||
FlowRouter.go(homePage);
|
||||
// here comeslogic for redirect
|
||||
if(oidcRedirectionEnabled)
|
||||
{
|
||||
window.location = oauthServerUrl + oauthDashboardUrl;
|
||||
}
|
||||
else
|
||||
{
|
||||
const homePage = 'home';
|
||||
if (FlowRouter.getRouteName() === homePage) {
|
||||
FlowRouter.reload();
|
||||
} else {
|
||||
FlowRouter.go(homePage);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue