mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 07:20:12 +01:00
Fixed Disable Self-Registration. Added Disable Forgot Password to same Admin Panel page.
Thanks to xet7 ! Fixes #3971, fixes #2839
This commit is contained in:
parent
9ca8d78514
commit
b85db43c47
6 changed files with 74 additions and 4 deletions
|
|
@ -1,5 +1,21 @@
|
|||
const passwordField = AccountsTemplates.removeField('password');
|
||||
const emailField = AccountsTemplates.removeField('email');
|
||||
let disableRegistration = true;
|
||||
let disableForgotPassword = true;
|
||||
|
||||
Meteor.call('getDisableRegistration', (err, data) => {
|
||||
if (!err) {
|
||||
disableRegistration = data;
|
||||
//console.log(data);
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.call('getDisableForgotPassword', (err, data) => {
|
||||
if (!err) {
|
||||
disableForgotPassword = data;
|
||||
//console.log(data);
|
||||
}
|
||||
});
|
||||
|
||||
AccountsTemplates.addFields([
|
||||
{
|
||||
|
|
@ -27,7 +43,8 @@ AccountsTemplates.configure({
|
|||
confirmPassword: true,
|
||||
enablePasswordChange: true,
|
||||
sendVerificationEmail: true,
|
||||
showForgotPasswordLink: true,
|
||||
showForgotPasswordLink: !disableForgotPassword,
|
||||
forbidClientAccountCreation: disableRegistration,
|
||||
onLogoutHook() {
|
||||
const homePage = 'home';
|
||||
if (FlowRouter.getRouteName() === homePage) {
|
||||
|
|
@ -38,11 +55,21 @@ AccountsTemplates.configure({
|
|||
},
|
||||
});
|
||||
|
||||
if (!disableForgotPassword) {
|
||||
[
|
||||
'forgotPwd',
|
||||
'resetPwd',
|
||||
].forEach(routeName => AccountsTemplates.configureRoute(routeName));
|
||||
}
|
||||
|
||||
if (!disableRegistration) {
|
||||
[
|
||||
'signUp',
|
||||
].forEach(routeName => AccountsTemplates.configureRoute(routeName));
|
||||
}
|
||||
|
||||
[
|
||||
'signIn',
|
||||
'signUp',
|
||||
'resetPwd',
|
||||
'forgotPwd',
|
||||
'enrollAccount',
|
||||
].forEach(routeName => AccountsTemplates.configureRoute(routeName));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue