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]]