I already have an existing user model in my django app. I don’t want to migrate my users to auth0. I want to keep both ways of logins. However, users access via auth0 can’t pass @login_required decorator. How to create a login session with auth0 data?
No. @login_required decorator uses request.user which is always Anonymous when authenticated by auth0. I wrote a small function that gets email from request.session.get(“user”), and then find the user. If the user is new, then create one. Set the “user” in the context before render.
Thanks for coming back to me - in the end I did exactly the same thing and created my own decorator ![]()
Cheers,
Andy