reCAPTCHAの設定をDBに保存するように

This commit is contained in:
syuilo
2018-11-07 00:08:21 +09:00
parent d5ab6b41c9
commit a6f8327aa2
10 changed files with 99 additions and 36 deletions

View File

@ -61,6 +61,19 @@ if ((config as any).preventCacheRemoteFiles) {
}
});
}
if ((config as any).recaptcha) {
Meta.findOne({}).then(m => {
if (m != null && m.enableRecaptcha == null) {
Meta.update({}, {
$set: {
enableRecaptcha: (config as any).recaptcha != null,
recaptchaSiteKey: (config as any).recaptcha.site_key,
recaptchaSecretKey: (config as any).recaptcha.secret_key,
}
});
}
});
}
export type IMeta = {
name?: string;
@ -79,6 +92,10 @@ export type IMeta = {
cacheRemoteFiles?: boolean;
enableRecaptcha?: boolean;
recaptchaSiteKey?: string;
recaptchaSecretKey?: string;
/**
* Drive capacity of a local user (MB)
*/