mirror of
https://github.com/wekan/wekan.git
synced 2026-02-25 09:24:08 +01:00
commit
e305bf019f
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.
|
// 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
|
// 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) {
|
if (doc.authenticationMethod !== 'ldap' && disableRegistration) {
|
||||||
const invitationCode = InvitationCodes.findOne({
|
let invitationCode = null;
|
||||||
code: doc.profile.icode,
|
if(doc.authenticationMethod.toLowerCase() == 'oauth2')
|
||||||
valid: true,
|
{ // 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) {
|
if (!invitationCode) {
|
||||||
throw new Meteor.Error('error-invitation-code-not-exist');
|
throw new Meteor.Error('error-invitation-code-not-exist');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue