disallow discord registration if code is required

This commit is contained in:
Erik 2023-02-08 00:42:16 +02:00
parent 9217103bae
commit 46ad540f68
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68

View File

@ -253,7 +253,7 @@ class Server extends EventEmitter {
this.logger.info(`${profile.username} (${profile.id}) is logging in.`); this.logger.info(`${profile.username} (${profile.id}) is logging in.`);
// We don't need this here // We don't need this here
delete profile.accessToken; delete profile.accessToken;
const user = await this.userDatabase.userFromDiscord(profile, !this.registrationEnabled); const user = await this.userDatabase.userFromDiscord(profile, !this.registrationEnabled || this.requireCodeForRegister);
let err = null; let err = null;
if (!user) if (!user)
err = new Error('No such user'); err = new Error('No such user');