🎨 added optional captcha to login route

This commit is contained in:
Flam3rboy
2021-05-01 13:54:12 +02:00
parent 5e9fb8a2a2
commit bbeab4da65
8 changed files with 64 additions and 37 deletions
-1
View File
@@ -1 +0,0 @@
export {};
+9 -2
View File
@@ -1,6 +1,5 @@
import { Config, Snowflake } from "@fosscord/server-util";
import crypto from "crypto";
import fs from "fs";
export default {
init() {
@@ -75,10 +74,14 @@ export interface DefaultOptions {
forwadedFor: string | null;
captcha: {
enabled: boolean;
service: "recaptcha" | null; // TODO: hcaptcha, custom
service: "recaptcha" | "hcaptcha" | null; // TODO: hcaptcha, custom
sitekey: string | null;
secret: string | null;
};
};
login: {
requireCaptcha: boolean;
};
register: {
email: {
required: boolean;
@@ -155,8 +158,12 @@ export const DefaultOptions: DefaultOptions = {
enabled: false,
service: null,
sitekey: null,
secret: null,
},
},
login: {
requireCaptcha: false,
},
register: {
email: {
required: true,