mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-22 16:30:13 +00:00
fix: email validation
This commit is contained in:
parent
5db583a3eb
commit
220344c552
2 changed files with 5 additions and 7 deletions
|
@ -167,18 +167,18 @@ export class EmailService {
|
||||||
const verifymailApi = meta.enableVerifymailApi && meta.verifymailAuthKey != null;
|
const verifymailApi = meta.enableVerifymailApi && meta.verifymailAuthKey != null;
|
||||||
let validated;
|
let validated;
|
||||||
|
|
||||||
if (meta.enableActiveEmailValidation && meta.verifymailAuthKey) {
|
if (meta.enableActiveEmailValidation) {
|
||||||
if (verifymailApi) {
|
if (verifymailApi && meta.verifymailAuthKey) {
|
||||||
validated = await this.verifyMail(emailAddress, meta.verifymailAuthKey);
|
validated = await this.verifyMail(emailAddress, meta.verifymailAuthKey);
|
||||||
} else {
|
} else {
|
||||||
validated = meta.enableActiveEmailValidation ? await validateEmail({
|
validated = await validateEmail({
|
||||||
email: emailAddress,
|
email: emailAddress,
|
||||||
validateRegex: true,
|
validateRegex: true,
|
||||||
validateMx: true,
|
validateMx: true,
|
||||||
validateTypo: false, // TLDを見ているみたいだけどclubとか弾かれるので
|
validateTypo: false, // TLDを見ているみたいだけどclubとか弾かれるので
|
||||||
validateDisposable: true, // 捨てアドかどうかチェック
|
validateDisposable: true, // 捨てアドかどうかチェック
|
||||||
validateSMTP: false, // 日本だと25ポートが殆どのプロバイダーで塞がれていてタイムアウトになるので
|
validateSMTP: false, // 日本だと25ポートが殆どのプロバイダーで塞がれていてタイムアウトになるので
|
||||||
}) : { valid: true, reason: null };
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
validated = { valid: true, reason: null };
|
validated = { valid: true, reason: null };
|
||||||
|
|
|
@ -61,9 +61,7 @@ export class FileServerService {
|
||||||
public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) {
|
public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) {
|
||||||
fastify.addHook('onRequest', (request, reply, done) => {
|
fastify.addHook('onRequest', (request, reply, done) => {
|
||||||
reply.header('Content-Security-Policy', 'default-src \'none\'; img-src \'self\'; media-src \'self\'; style-src \'unsafe-inline\'');
|
reply.header('Content-Security-Policy', 'default-src \'none\'; img-src \'self\'; media-src \'self\'; style-src \'unsafe-inline\'');
|
||||||
if (process.env.NODE_ENV === 'development') {
|
|
||||||
reply.header('Access-Control-Allow-Origin', '*');
|
reply.header('Access-Control-Allow-Origin', '*');
|
||||||
}
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue