diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-05-13 16:59:56 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-05-13 16:59:56 +0100 |
commit | 1f71f386f68423c00e0d4180ae48b271864b42a5 (patch) | |
tree | 9dd45307ffd592023a8334e90d2c2180f4463225 /synapse/handlers/auth.py | |
parent | Shift some of the state_group methods into the SlavedEventStore (diff) | |
parent | Merge pull request #783 from matrix-org/markjh/slave_account_data (diff) | |
download | synapse-1f71f386f68423c00e0d4180ae48b271864b42a5.tar.xz |
Merge branch 'develop' into dbkr/email_notifs_on_pusher
Diffstat (limited to 'synapse/handlers/auth.py')
-rw-r--r-- | synapse/handlers/auth.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index 6e7d080ecc..68d0d78fc6 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -521,11 +521,11 @@ class AuthHandler(BaseHandler): )) return m.serialize() - def generate_short_term_login_token(self, user_id): + def generate_short_term_login_token(self, user_id, duration_in_ms=(2 * 60 * 1000)): macaroon = self._generate_base_macaroon(user_id) macaroon.add_first_party_caveat("type = login") now = self.hs.get_clock().time_msec() - expiry = now + (2 * 60 * 1000) + expiry = now + duration_in_ms macaroon.add_first_party_caveat("time < %d" % (expiry,)) return macaroon.serialize() |