#NEWLINE# def generate_short_term_login_token( self , user_id ) : #NEWLINE# #INDENT# macaroon = self . _generate_base_macaroon ( user_id ) #NEWLINE# macaroon . add_first_party_caveat ( 'type = login' ) #NEWLINE# now = self . hs . get_clock ( ) . time_msec ( ) #NEWLINE# expiry = ( now + ( ( 2 * 60 ) * 1000 ) ) #NEWLINE# macaroon . add_first_party_caveat ( ( 'time < %d' % ( expiry , ) ) ) #NEWLINE# return macaroon . serialize ( )