Code Monkey home page Code Monkey logo

Comments (6)

clokep avatar clokep commented on July 20, 2024 1

This is probably happening because we add user.id to the session (see https://github.com/percipient/django-allauth-2fa/blob/6d666d634ded380c4a7f660ac5a729fae095ffb2/allauth_2fa/adapter.py#L22-L24), which I guess is of type UUID? (I've never used a UUIDField, is the value a UUID object, not a string?)

It might work to cast to a string when adding it to the session, like: request.session['allauth_2fa_user_id'] = str(user.id)

from django-allauth-2fa.

chromakey avatar chromakey commented on July 20, 2024 1

That indeed worked. Thanks! I'll submit a PR today with the change.

from django-allauth-2fa.

chromakey avatar chromakey commented on July 20, 2024 1

I'm not sure how I'd write a good test in the current context. Since the current user model defaults to using IntegerField as the ID/PK, I supposed I'd have to write a dummy user model?

from django-allauth-2fa.

clokep avatar clokep commented on July 20, 2024

Awesome! πŸ’₯ Please include tests with your PR! I'll try to review it within the next few days.

from django-allauth-2fa.

clokep avatar clokep commented on July 20, 2024

I'll think a bit about how to test this.

from django-allauth-2fa.

teevyne avatar teevyne commented on July 20, 2024

I'll think a bit about how to test this.

@clokep Hi Patrick. Thank you for this response. I have run into a similar issue but this is when I try to login.
The registration part works fine, but logging in isn't quite working. My login parameters are email and password

What could I be getting wrong?

from django-allauth-2fa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.