Fix bad merge

This commit is contained in:
Daniel Wagner-Hall 2015-08-20 17:43:12 +01:00
parent 8c74bd8960
commit c7788685b0
1 changed files with 1 additions and 8 deletions

View File

@ -318,18 +318,11 @@ class AuthHandler(BaseHandler):
defer.returnValue(refresh_token) defer.returnValue(refresh_token)
def generate_access_token(self, user_id): def generate_access_token(self, user_id):
macaroon = pymacaroons.Macaroon( macaroon = self._generate_base_macaroon(user_id)
location=self.hs.config.server_name,
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("type = access") macaroon.add_first_party_caveat("type = access")
now = self.hs.get_clock().time_msec() now = self.hs.get_clock().time_msec()
expiry = now + (60 * 60 * 1000) expiry = now + (60 * 60 * 1000)
macaroon.add_first_party_caveat("time < %d" % (expiry,)) macaroon.add_first_party_caveat("time < %d" % (expiry,))
return macaroon.serialize() return macaroon.serialize()
def generate_refresh_token(self, user_id): def generate_refresh_token(self, user_id):