summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/handlers/register.py8
-rw-r--r--tests/handlers/test_register.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index 86bacdda1d..c391c1bdf5 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -279,11 +279,11 @@ class RegistrationHandler(BaseHandler):
             identifier = "key",
             key = self.hs.config.macaroon_secret_key)
         macaroon.add_first_party_caveat("gen = 1")
-        macaroon.add_first_party_caveat("user_id = %s" % user_id)
+        macaroon.add_first_party_caveat("user_id = %s" % (user_id,))
         macaroon.add_first_party_caveat("type = access")
-        now = self.hs.get_clock().time()
-        expiry = now + 60 * 60
-        macaroon.add_first_party_caveat("time < %s" % expiry)
+        now = self.hs.get_clock().time_msec()
+        expiry = now + (60 * 60 * 1000)
+        macaroon.add_first_party_caveat("time < %d" % (expiry,))
 
         return macaroon.serialize()
 
diff --git a/tests/handlers/test_register.py b/tests/handlers/test_register.py
index b28b1a7ef0..0766affe81 100644
--- a/tests/handlers/test_register.py
+++ b/tests/handlers/test_register.py
@@ -67,4 +67,4 @@ class RegisterTestCase(unittest.TestCase):
         v.satisfy_general(verify_user)
         v.satisfy_general(verify_type)
         v.satisfy_general(verify_expiry)
-        v.verify(macaroon, self.hs.config.macaroon_secret_key)
\ No newline at end of file
+        v.verify(macaroon, self.hs.config.macaroon_secret_key)