diff --git a/shopinvader_api_signin_jwt/README.rst b/shopinvader_api_signin_jwt/README.rst index d9b9dd5b6c..91d3e860f3 100644 --- a/shopinvader_api_signin_jwt/README.rst +++ b/shopinvader_api_signin_jwt/README.rst @@ -7,7 +7,7 @@ Shopinvader Api Signin JWT !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:59c45a1d4cbece13c06acf5a0b621bf113fd94ed74b05de2143494c755320354 + !! source digest: sha256:7337f1eba6afcff7201a9185515fa52033fa3c544861e8b59aa71ed2545d6a7b !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -25,6 +25,11 @@ Shopinvader Api Signin JWT 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:: diff --git a/shopinvader_api_signin_jwt/readme/DESCRIPTION.rst b/shopinvader_api_signin_jwt/readme/DESCRIPTION.rst index 9d807c0111..6c7b1254c9 100644 --- a/shopinvader_api_signin_jwt/readme/DESCRIPTION.rst +++ b/shopinvader_api_signin_jwt/readme/DESCRIPTION.rst @@ -1,2 +1,7 @@ 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. diff --git a/shopinvader_api_signin_jwt/routers/signin.py b/shopinvader_api_signin_jwt/routers/signin.py index 89bac0a70d..51c67882ec 100644 --- a/shopinvader_api_signin_jwt/routers/signin.py +++ b/shopinvader_api_signin_jwt/routers/signin.py @@ -34,6 +34,7 @@ def signin( Authenticate the partner based on a JWT token or a session cookie. Set the session cookie if allowed. Return HTTP code 201 if res.partner created (case of the first signin). + Promote anonymous partner and delete it if any. """ if not partner: partner = env[ @@ -41,6 +42,8 @@ def signin( ]._create_partner_from_payload(payload) response.status_code = status.HTTP_201_CREATED + env["res.partner"]._promote_anonymous_partner(partner, request.cookies, response) + @signin_router.post("/signout") def signout( diff --git a/shopinvader_api_signin_jwt/static/description/index.html b/shopinvader_api_signin_jwt/static/description/index.html index f80480721d..d3c5876259 100644 --- a/shopinvader_api_signin_jwt/static/description/index.html +++ b/shopinvader_api_signin_jwt/static/description/index.html @@ -9,11 +9,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. -Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -276,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -302,7 +301,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -368,11 +367,15 @@

Shopinvader Api Signin JWT

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:59c45a1d4cbece13c06acf5a0b621bf113fd94ed74b05de2143494c755320354 +!! source digest: sha256:d2a37ed8f608aa991e96f29205867b36c47bf9ec58fd392ec4ee8d6f386da0f2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 shopinvader/odoo-shopinvader

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