Skip to content
This repository was archived by the owner on Sep 17, 2024. It is now read-only.

Commit b6ac9e7

Browse files
committed
feat(lobbies); add captcha config
1 parent 2c4a637 commit b6ac9e7

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

modules/lobbies/config.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface Config {
1111
unconnectedExpireAfter: number;
1212
autoDestroyAfter?: number;
1313
};
14+
captcha?: CaptchaProvider;
1415
}
1516

1617
export interface LobbyRule {
@@ -42,3 +43,18 @@ export interface PlayerRange {
4243

4344
export type LobbyBackend = { test: BackendTestConfig } | { localDevelopment: BackendLocalDevelopmentConfig } | { server: BackendServerConfig };
4445

46+
47+
export type CaptchaProvider = { test: Record<never, never> }
48+
| { turnstile: ProviderCFTurnstile }
49+
| { hcaptcha: ProviderHCaptcha };
50+
51+
export interface ProviderCFTurnstile {
52+
sitekey: string;
53+
secret: string;
54+
}
55+
56+
export interface ProviderHCaptcha {
57+
// TODO: Score threshold
58+
sitekey: string;
59+
secret: string;
60+
}

tests/basic/backend.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
],
7171
"test": {}
7272
}
73+
},
74+
"captcha": {
75+
"provider": {
76+
"test": {}
77+
}
7378
}
7479
}
7580
},

0 commit comments

Comments
 (0)