Django: Login a user after a webhook event

devs3.pro
Devs3
Published on Jan, 22 2024 1 min read 0 comments
image

i am making an ecommerce app giving users session based cart and allowing then to checkout and enter their email(required) there, where when stripe webhook ping about that checkout session i create that user based on his email or get them from database if it exists, and want to log them in and move to set password page, but in django i cant use login(request, user), because request arent user generated through i have the user object, how can i achieve this functionality.

i am passing session key in webhook, so that i can gather the items in those cart and process and delete them after, and gets the user or create them in the webhook.

0 Answers