-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gh_1584' into 'update_version_110'
Passkey support for login #1584 See merge request gh/20c/django-security-keys!1
- Loading branch information
Showing
17 changed files
with
304 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/django_security_keys/migrations/0004_remove_securitykey_passwordless_login_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from django.db import migrations, models | ||
|
||
def migrate_passwordless_login_to_passkey_login(apps, schema_editor): | ||
model = apps.get_model("django_security_keys", "SecurityKey") | ||
try: | ||
model._meta.get_field("updated").auto_now = False | ||
for key in model.objects.all(): | ||
key.passkey_login = key.passwordless_login | ||
key.save(update_fields=['passkey_login']) | ||
finally: | ||
model._meta.get_field("updated").auto_now = False | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("django_security_keys", "0003_date_fields"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="securitykey", | ||
name="passkey_login", | ||
field=models.BooleanField( | ||
default=False, help_text="User has enabled this key for passkey login" | ||
), | ||
), | ||
migrations.RunPython(migrate_passwordless_login_to_passkey_login), | ||
migrations.RemoveField( | ||
model_name="securitykey", | ||
name="passwordless_login", | ||
), | ||
] |
Oops, something went wrong.