mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-12-10 13:47:47 +01:00
fix: use note name instead of username
This commit is contained in:
@@ -28,7 +28,7 @@ class UserInformationView(mixins.RetrieveModelMixin, viewsets.GenericViewSet):
|
||||
|
||||
def qrcode(self, request, *args, **kwargs):
|
||||
secret = base64.b32encode(os.getenv("DJANGO_SECRET_KEY").encode())
|
||||
qr_img = qrcode.make(f"{str(request.user.username)}{pyotp.TOTP(secret, interval=30).now()}")
|
||||
qr_img = qrcode.make(f"{str(request.user.note)}{pyotp.TOTP(secret, interval=30).now()}")
|
||||
buffer = BytesIO()
|
||||
qr_img.save(buffer, format="PNG")
|
||||
buffer.seek(0)
|
||||
|
||||
Reference in New Issue
Block a user