openfoodfacts / community-portal

A community portal for Open Food Facts contributors
https://wiki.openfoodfacts.org/GSOC_2022_-_Community_federation_portal
GNU Affero General Public License v3.0
6 stars 2 forks source link

Building the authentication page (Django REST Framework) and adding all its functionality #7

Open alexgarel opened 2 years ago

alexgarel commented 2 years ago

What

alexgarel commented 2 years ago

Maybe blocked by https://github.com/openfoodfacts/openfoodfacts-server/issues/6462 (priority on @alexgarel)

To test it locally: edit your /etc/hosts (or equivalent windows) to have community.openfoodfacts.net point to 127.0.0.1, then use this address in your browser to test. If not possible on windows, ask Stephane, to add a test-community.openfoodfacts.net in our DNS pointing to 127.0.0.1.

stephanegigandet commented 2 years ago

@sumit-158 : To check if the user is authentified, call https://world.openfoodfacts.org/cgi/session.pl?jqm=1 with the session cookie.

If the user is identified, you will get a response like this one:

{ name: "Stéphane Gigandet", user_id: "stephane" }

M123-dev commented 2 years ago

If there isn't a cookie we can use the wrapper around login from off-dart but we would still have to somehow write the cookie