From d4712c581959dde97775729f8e7f5452e284cfce Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 10 Mar 2022 23:16:33 -0800 Subject: [PATCH] fix spacing issue on msg sign --- tubbymemes/models.py | 4 ++-- tubbymemes/templates/includes/scripts.html | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tubbymemes/models.py b/tubbymemes/models.py index e53c2e3..89a78b2 100644 --- a/tubbymemes/models.py +++ b/tubbymemes/models.py @@ -52,10 +52,10 @@ class User(db.Model): return self.id def generate_nonce(self): - return rand_id() + return rand_id()[0:8] def change_nonce(self): - self.nonce = rand_id() + self.nonce = self.generate_nonce() self.nonce_date = datetime.utcnow() db.session.commit() diff --git a/tubbymemes/templates/includes/scripts.html b/tubbymemes/templates/includes/scripts.html index 445ffb0..9a53a2f 100644 --- a/tubbymemes/templates/includes/scripts.html +++ b/tubbymemes/templates/includes/scripts.html @@ -76,7 +76,9 @@ nonce = data['nonce']; }) - const msg = 'Authentication request from tubbymemes app! Verifying message with nonce ' + nonce + const msg = `Authentication request from tubbymemes app! + +Verifying message with nonce ${nonce}` const signedData = await window.ethereum.request({ method: 'personal_sign', params: [msg, allAccounts[0]]