Metadata-Version: 2.1
Name: odoo-addon-shopinvader_api_signin_jwt
Version: 16.0.2.0.0
Summary: This module adds a signin service with jwt token.
Home-page: https://github.com/shopinvader/odoo-shopinvader
Author: ACSONE SA/NV
License: AGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Requires-Dist: odoo-addon-fastapi-auth-jwt<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-shopinvader-anonymous-partner<16.1dev,>=16.0dev
Requires-Dist: odoo<16.1dev,>=16.0a

.. 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:48446ccc5802e78515d2d38900710d964d6b4516b14316cc7f25d165f0295d31
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/16.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-block:: 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:%2016.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/16.0/shopinvader_api_signin_jwt>`_ project on GitHub.

You are welcome to contribute.
