mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 14:08:31 -04:00
fix issue #4222
This commit is contained in:
parent
5cf352defb
commit
505c2da072
1 changed files with 14 additions and 4 deletions
|
@ -1683,10 +1683,20 @@ if (Meteor.isServer) {
|
|||
// If ldap, bypass the inviation code if the self registration isn't allowed.
|
||||
// TODO : pay attention if ldap field in the user model change to another content ex : ldap field to connection_type
|
||||
if (doc.authenticationMethod !== 'ldap' && disableRegistration) {
|
||||
const invitationCode = InvitationCodes.findOne({
|
||||
code: doc.profile.icode,
|
||||
valid: true,
|
||||
});
|
||||
let invitationCode = null;
|
||||
if(doc.authenticationMethod.toLowerCase() == 'oauth2')
|
||||
{ // OIDC authentication mode
|
||||
invitationCode = InvitationCodes.findOne({
|
||||
email: doc.emails[0].address.toLowerCase(),
|
||||
valid: true,
|
||||
});
|
||||
}
|
||||
else{
|
||||
invitationCode = InvitationCodes.findOne({
|
||||
code: doc.profile.icode,
|
||||
valid: true,
|
||||
});
|
||||
}
|
||||
if (!invitationCode) {
|
||||
throw new Meteor.Error('error-invitation-code-not-exist');
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue