diff --git a/README.md b/README.md index f4973651df..c4f4747ed6 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- +[website_cf_turnstile_login](website_cf_turnstile_login/) | 18.0.1.0.0 | adasatorres | Add Cloudflare Turnstile captcha to login form [website_cookiebot](website_cookiebot/) | 18.0.1.0.0 | | Ask for cookies consent connecting with Cookiebot [website_cookiefirst](website_cookiefirst/) | 18.0.2.0.0 | | Cookiefirst integration [website_form_require_legal](website_form_require_legal/) | 18.0.1.0.0 | | Add possibility to require confirm legal terms. diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index 47dc469a5f..50478778f8 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,7 +1,8 @@ [project] name = "odoo-addons-oca-website" -version = "18.0.20260102.0" +version = "18.0.20260210.0" dependencies = [ + "odoo-addon-website_cf_turnstile_login==18.0.*", "odoo-addon-website_cookiebot==18.0.*", "odoo-addon-website_cookiefirst==18.0.*", "odoo-addon-website_form_require_legal==18.0.*", diff --git a/website_cf_turnstile_login/README.rst b/website_cf_turnstile_login/README.rst new file mode 100644 index 0000000000..0691b505d4 --- /dev/null +++ b/website_cf_turnstile_login/README.rst @@ -0,0 +1,90 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================= +Cloudflare Turnstile on Login +============================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:8cda524ef2ed768833ddbfa65e04f0a6cc2b7d8d04698e654124f4bd829bfce4 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github + :target: https://github.com/OCA/website/tree/18.0/website_cf_turnstile_login + :alt: OCA/website +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/website-18-0/website-18-0-website_cf_turnstile_login + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This add-on adds Cloudflare Turnstile validation to the login form. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Binhex + +Contributors +------------ + +- `Binhex `__: + + - Adasat Torres de León + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-adasatorres| image:: https://github.com/adasatorres.png?size=40px + :target: https://github.com/adasatorres + :alt: adasatorres + +Current `maintainer `__: + +|maintainer-adasatorres| + +This module is part of the `OCA/website `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/website_cf_turnstile_login/__init__.py b/website_cf_turnstile_login/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/website_cf_turnstile_login/__manifest__.py b/website_cf_turnstile_login/__manifest__.py new file mode 100644 index 0000000000..bc7b09d713 --- /dev/null +++ b/website_cf_turnstile_login/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2026 - Binhex, Adasat Torres de León +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). +{ + "name": "Cloudflare Turnstile on Login", + "summary": "Add Cloudflare Turnstile captcha to login form", + "version": "18.0.1.0.0", + "author": "Binhex, Odoo Community Association (OCA)", + "maintainers": ["adasatorres"], + "website": "https://github.com/OCA/website", + "license": "AGPL-3", + "category": "Website", + "depends": ["website_cf_turnstile"], + "assets": { + "web.assets_frontend": ["website_cf_turnstile_login/static/src/js/*.*"], + }, +} diff --git a/website_cf_turnstile_login/i18n/website_cf_turnstile_login.pot b/website_cf_turnstile_login/i18n/website_cf_turnstile_login.pot new file mode 100644 index 0000000000..aadee09bfe --- /dev/null +++ b/website_cf_turnstile_login/i18n/website_cf_turnstile_login.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/website_cf_turnstile_login/pyproject.toml b/website_cf_turnstile_login/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/website_cf_turnstile_login/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/website_cf_turnstile_login/readme/CONTRIBUTORS.md b/website_cf_turnstile_login/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..d0eef49cbf --- /dev/null +++ b/website_cf_turnstile_login/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Binhex](https://www.binhex.cloud): + - Adasat Torres de León + diff --git a/website_cf_turnstile_login/readme/DESCRIPTION.md b/website_cf_turnstile_login/readme/DESCRIPTION.md new file mode 100644 index 0000000000..a1c21fc4a7 --- /dev/null +++ b/website_cf_turnstile_login/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This add-on adds Cloudflare Turnstile validation to the login form. \ No newline at end of file diff --git a/website_cf_turnstile_login/static/description/icon.png b/website_cf_turnstile_login/static/description/icon.png new file mode 100644 index 0000000000..1dcc49c24f Binary files /dev/null and b/website_cf_turnstile_login/static/description/icon.png differ diff --git a/website_cf_turnstile_login/static/description/index.html b/website_cf_turnstile_login/static/description/index.html new file mode 100644 index 0000000000..44d32477a1 --- /dev/null +++ b/website_cf_turnstile_login/static/description/index.html @@ -0,0 +1,434 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Cloudflare Turnstile on Login

+ +

Beta License: AGPL-3 OCA/website Translate me on Weblate Try me on Runboat

+

This add-on adds Cloudflare Turnstile validation to the login form.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Binhex
  • +
+
+
+

Contributors

+
    +
  • Binhex:
      +
    • Adasat Torres de León
    • +
    +
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

adasatorres

+

This module is part of the OCA/website project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/website_cf_turnstile_login/static/src/js/turnstileCaptchaSignIn.esm.js b/website_cf_turnstile_login/static/src/js/turnstileCaptchaSignIn.esm.js new file mode 100644 index 0000000000..7d2bf341ee --- /dev/null +++ b/website_cf_turnstile_login/static/src/js/turnstileCaptchaSignIn.esm.js @@ -0,0 +1,30 @@ +/** @odoo-module **/ + +import publicWidget from "@web/legacy/js/public/public_widget"; +import {turnStile} from "@website_cf_turnstile/js/turnstile"; +import {session} from "@web/session"; + +const signinTurnStile = { + ...turnStile, + + async willStart() { + this._super(...arguments); + if (!session.turnstile_site_key) { + return; + } + const button = this.el.querySelector('button[type="submit"]'); + this.addSpinner(button); + this.cleanTurnstile(); + const turnstileNodes = this.addTurnstile(this.action); + turnstileNodes?.insertBefore(button); + this.renderTurnstile(turnstileNodes); + }, +}; + +publicWidget.registry.turnstileCaptchaSignin = publicWidget.Widget.extend({ + ...signinTurnStile, + selector: ".oe_login_form", + action: "signin", +}); + +export default signinTurnStile;