diff --git a/api/tacticalrmm/accounts/management/commands/delete_tokens.py b/api/tacticalrmm/accounts/management/commands/delete_tokens.py new file mode 100644 index 00000000..5765b2b4 --- /dev/null +++ b/api/tacticalrmm/accounts/management/commands/delete_tokens.py @@ -0,0 +1,10 @@ +from django.core.management.base import BaseCommand +from knox.models import AuthToken + + +class Command(BaseCommand): + help = "Deletes all knox tokens" + + def handle(self, *args, **kwargs): + AuthToken.objects.all().delete() + self.stdout.write("All tokens have been deleted!") diff --git a/update.sh b/update.sh index 88e9202e..2fff581c 100644 --- a/update.sh +++ b/update.sh @@ -14,6 +14,7 @@ cd /home/${USER}/rmm/api/tacticalrmm pip install -r /home/${USER}/rmm/api/tacticalrmm/requirements.txt python manage.py makemigrations python manage.py migrate +python manage.py delete_tokens deactivate