jazzband / django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
MIT License
1.71k stars 448 forks source link

Add json field to PhoneDevice model #635

Closed NewGlad closed 9 months ago

NewGlad commented 1 year ago

Description

JSON field to PhoneDevice model to have an ability to store arbitary data

Motivation and Context

In my project in addition to the existing field declared in the PhoneDevice model, I also want to store some additional data, such as request id, timestamp of last sms sent, and some more I think that it is a very common desire, so looks like it is very convenient to have some field with arbitrary structure to have a way to store some additional data in the standard model

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

moggers87 commented 9 months ago

Not sure I see the need for this in django-two-factor-auth. You can get the same effect by using Django's multi table inheritance i.e. subclass PhoneDevice and use your subclass when you want to access the additional fields.

Closing this PR as it's over 6 months old, feel free to comment if you disagree :smiley_cat: