Metadata-Version: 2.1
Name: odoo-addon-shopinvader_api_signin_jwt
Version: 18.0.1.0.0.2
Requires-Python: >=3.10
Requires-Dist: odoo-addon-fastapi_auth_jwt==18.0.*
Requires-Dist: odoo-addon-shopinvader_anonymous_partner==18.0.*
Requires-Dist: odoo-addon-shopinvader_router_helper==18.0.*
Requires-Dist: odoo==18.0.*
Summary: This module adds a signin service with jwt token.
Home-page: https://github.com/shopinvader/odoo-shopinvader
License: AGPL-3
Author: ACSONE SA/NV
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

==========================
Shopinvader Api Signin JWT
==========================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:8af27064ae77898bcc3ef163de4875bbe33a3b5e9ae40f1672b35d97fb421586
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github
    :target: https://github.com/shopinvader/odoo-shopinvader/tree/18.0/shopinvader_api_signin_jwt
    :alt: shopinvader/odoo-shopinvader

|badge1| |badge2| |badge3|

This addon adds a web API to signin into the application and create a
partner if the email in the jwt payload is unknown.

This addon supports the "anonymous partner" feature, which allows to
create carts for user that are not loggedin. When you login from an
anonymous partner, your cart is transfered to your real partner, and
your anonymous partner is deleted.

**Table of contents**

.. contents::
   :local:

Installation
============

To enable anonymous carts, you'll need the module
``shopinvader_fastapi_auth_jwt``. And use it's dependency
``auth_jwt_authenticated_or_anonymous_partner_autocreate`` when mounting
your cart router, such as:

.. code:: python

   cart_app = FastAPI()
   cart_app.include_router(cart_router)
   cart_app.dependency_overrides.update(
       {
           authenticated_partner_impl: auth_jwt_authenticated_or_anonymous_partner_autocreate,
       }
   )

Example of a full implementation with jwt signin and anonymous carts can
be found in the demo module ``shopinvader_v2_app_demo``.

Known issues / Roadmap
======================

- Use ``fastapi_auth_jwt.auth_jwt_authenticated_odoo_env`` dependency
  for the env (see https://github.com/OCA/rest-framework/issues/406)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/shopinvader/odoo-shopinvader/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 <https://github.com/shopinvader/odoo-shopinvader/issues/new?body=module:%20shopinvader_api_signin_jwt%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* ACSONE SA/NV

Contributors
------------

- Quentin Groulard <quentin.groulard@acsone.eu>

Maintainers
-----------

This module is part of the `shopinvader/odoo-shopinvader <https://github.com/shopinvader/odoo-shopinvader/tree/18.0/shopinvader_api_signin_jwt>`_ project on GitHub.

You are welcome to contribute.
