feat (altcha) #4827 upgrade d'altcha en v2
Some checks are pending
Cadoles/hydra-sql/pipeline/pr-develop Build started...

This commit is contained in:
aardouin 2025-06-12 15:07:32 +02:00 committed by Gauthier DUPONT
parent 646c346537
commit f5d3a8d83b
8 changed files with 7 additions and 71 deletions

View File

@ -1,4 +1,5 @@
import './styles/theme.css' import './styles/theme.css'
import 'altcha'; import 'altcha';
import 'altcha/i18n/all';
import theme from './theme'; import theme from './theme';

7
package-lock.json generated
View File

@ -7,7 +7,7 @@
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {
"add": "^2.0.6", "add": "^2.0.6",
"altcha": "^1.0.0", "altcha": "^2.0.0",
"autoprefixer": "^10.4.4", "autoprefixer": "^10.4.4",
"bootstrap": "^5.2.3", "bootstrap": "^5.2.3",
"jquery": "^3.6.1", "jquery": "^3.6.1",
@ -2346,8 +2346,9 @@
} }
}, },
"node_modules/altcha": { "node_modules/altcha": {
"version": "1.4.2", "version": "2.0.3",
"hasInstallScript": true, "resolved": "https://registry.npmjs.org/altcha/-/altcha-2.0.3.tgz",
"integrity": "sha512-vrrolHI721LOegDSJYnf2oRYlP2VIi83N9wrJe+PrjkV1O7wlMcBxlp5uAch4RdsReCYgt6IJ7CAbbk/3esRoA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@altcha/crypto": "^0.0.1" "@altcha/crypto": "^0.0.1"

View File

@ -26,6 +26,6 @@
"postcss-loader": "^7.0.2", "postcss-loader": "^7.0.2",
"sass": "^1.56.2", "sass": "^1.56.2",
"sass-loader": "^13.2.0", "sass-loader": "^13.2.0",
"altcha": "^1.0.0" "altcha": "^2.0.0"
} }
} }

View File

@ -38,15 +38,6 @@ class AltchaType extends AbstractType
public function buildView(FormView $view, FormInterface $form, array $options) public function buildView(FormView $view, FormInterface $form, array $options)
{ {
$translations = [
'label' => $this->translator->trans('altcha.widget.label', [], 'form'),
'verified' => $this->translator->trans('altcha.widget.verified', [], 'form'),
'verifying' => $this->translator->trans('altcha.widget.verifying', [], 'form'),
'waitAlert' => $this->translator->trans('altcha.widget.waitalert', [], 'form'),
'error' => $this->translator->trans('altcha.widget.error', [], 'form'),
'expired' => $this->translator->trans('altcha.widget.expired', [], 'form'),
];
$view->vars['translations'] = json_encode($translations);
$view->vars['challengeJson'] = $this->requestChallenge(); $view->vars['challengeJson'] = $this->requestChallenge();
$view->vars['debug'] = $this->altchaDebug; $view->vars['debug'] = $this->altchaDebug;
$view->vars['workers'] = $this->altchaWorkers; $view->vars['workers'] = $this->altchaWorkers;

View File

@ -2,7 +2,6 @@
<altcha-widget <altcha-widget
challengejson={{challengeJson}} challengejson={{challengeJson}}
name='altcha' name='altcha'
strings="{{translations}}"
hidelogo hidelogo
hidefooter hidefooter
workers= {{ workers }} workers= {{ workers }}

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="{{app.request.session.get('_locale') is not null ? app.request.session.get('_locale') : 'fr'}}">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title> <title>{% block title %}Welcome!{% endblock %}</title>

View File

@ -21,38 +21,10 @@
<source>altcha.validator.server_validation_error</source> <source>altcha.validator.server_validation_error</source>
<target>Verification failed. Try again later.</target> <target>Verification failed. Try again later.</target>
</trans-unit> </trans-unit>
<trans-unit id="7mZdXx_" resname="altcha.widget.error">
<source>altcha.widget.error</source>
<target>Verification failed. Try again later.</target>
</trans-unit>
<trans-unit id="Yg33QZt" resname="altcha.widget.expired">
<source>altcha.widget.expired</source>
<target>Verification expired. Try again.</target>
</trans-unit>
<trans-unit id="3y0.Bhb" resname="altcha.widget.label">
<source>altcha.widget.label</source>
<target>I'm not a robot</target>
</trans-unit>
<trans-unit id="QFBWtGD" resname="altcha.widget.verified">
<source>altcha.widget.verified</source>
<target>Verified</target>
</trans-unit>
<trans-unit id="SfOrgtj" resname="altcha.widget.verifying">
<source>altcha.widget.verifying</source>
<target>Verifying...</target>
</trans-unit>
<trans-unit id="9dhbPuz" resname="altcha.widget.waitalert">
<source>altcha.widget.waitalert</source>
<target>Verifying... please wait.</target>
</trans-unit>
<trans-unit id="9k5hI.D" resname="altcha.widget.title"> <trans-unit id="9k5hI.D" resname="altcha.widget.title">
<source>altcha.widget.title</source> <source>altcha.widget.title</source>
<target>Verification *</target> <target>Verification *</target>
</trans-unit> </trans-unit>
<trans-unit id="vGcy2C3" resname="altcha.widget.info">
<source>altcha.widget.info</source>
<target>Please check the box above to validate that you are not a robot. If you encounter any problem while doing this, please update your browser.</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>

View File

@ -21,38 +21,10 @@
<source>altcha.validator.server_validation_error</source> <source>altcha.validator.server_validation_error</source>
<target>Échec de la vérification. Réessayez plus tard.</target> <target>Échec de la vérification. Réessayez plus tard.</target>
</trans-unit> </trans-unit>
<trans-unit id="7mZdXx_" resname="altcha.widget.error">
<source>altcha.widget.error</source>
<target>Échec de la vérification. Réesayez plus tard.</target>
</trans-unit>
<trans-unit id="Yg33QZt" resname="altcha.widget.expired">
<source>altcha.widget.expired</source>
<target>Vérification expirée. Réessayez.</target>
</trans-unit>
<trans-unit id="3y0.Bhb" resname="altcha.widget.label">
<source>altcha.widget.label</source>
<target>Je ne suis pas un robot</target>
</trans-unit>
<trans-unit id="QFBWtGD" resname="altcha.widget.verified">
<source>altcha.widget.verified</source>
<target>Vérifié</target>
</trans-unit>
<trans-unit id="SfOrgtj" resname="altcha.widget.verifying">
<source>altcha.widget.verifying</source>
<target>Vérification en cours...</target>
</trans-unit>
<trans-unit id="9dhbPuz" resname="altcha.widget.waitalert">
<source>altcha.widget.waitalert</source>
<target>Vérification en cours... veuillez patienter.</target>
</trans-unit>
<trans-unit id="9k5hI.D" resname="altcha.widget.title"> <trans-unit id="9k5hI.D" resname="altcha.widget.title">
<source>altcha.widget.title</source> <source>altcha.widget.title</source>
<target>Vérification *</target> <target>Vérification *</target>
</trans-unit> </trans-unit>
<trans-unit id="vGcy2C3" resname="altcha.widget.info">
<source>altcha.widget.info</source>
<target>Veuillez cocher la case ci dessus afin de valider que vous n'êtes pas un robot. Si vous rencontrez un problème lors de cette action, mettez à jour votre navigateur.</target>
</trans-unit>
</body> </body>
</file> </file>
</xliff> </xliff>