fix(plugin-users): fix initialization of sms verification (#1173)

This commit is contained in:
Junyi 2022-12-01 18:19:40 -08:00 committed by GitHub
parent e73695fd1e
commit 1aa5df88c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -154,6 +154,11 @@ export default class UsersPlugin extends Plugin<UserPluginConfig> {
if (!verificationPlugin) {
return;
}
const systemSettingsRepo = this.db.getRepository('systemSettings');
const settings = await systemSettingsRepo.findOne();
if (!settings.smsAuthEnabled) {
return;
}
verificationPlugin.interceptors.register('users:signin', {
manual: true,

View File

@ -84,6 +84,7 @@ export default class VerificationPlugin extends Plugin {
} = process.env;
if (
DEFAULT_SMS_VERIFY_CODE_PROVIDER &&
INIT_ALI_SMS_ACCESS_KEY &&
INIT_ALI_SMS_ACCESS_KEY_SECRET &&
INIT_ALI_SMS_VERIFY_CODE_TEMPLATE &&