mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
* show recaptcha in the site footer * replace badge in footer with text * add invisible reCaptcha v2 * handle unsolved reCaptcha case * migrate the rest of components to invisible reCaptcha v2 * remove unused code * refactoring * add env for demo * fix tests * update values for demo * update link to secret in vault * mock recaptcha for tests * ohhh victor victor * fix token metadata update test * deprecate variable for ReCaptcha v3
24 lines
551 B
TypeScript
24 lines
551 B
TypeScript
import type { Feature } from './types';
|
|
|
|
import services from '../services';
|
|
import { getEnvValue } from '../utils';
|
|
|
|
const title = 'My account';
|
|
|
|
const config: Feature<{ isEnabled: true; recaptchaSiteKey: string }> = (() => {
|
|
if (getEnvValue('NEXT_PUBLIC_IS_ACCOUNT_SUPPORTED') === 'true' && services.reCaptchaV2.siteKey) {
|
|
return Object.freeze({
|
|
title,
|
|
isEnabled: true,
|
|
recaptchaSiteKey: services.reCaptchaV2.siteKey,
|
|
});
|
|
}
|
|
|
|
return Object.freeze({
|
|
title,
|
|
isEnabled: false,
|
|
});
|
|
})();
|
|
|
|
export default config;
|