#NEWLINE# def gen_token( self , token , auth_exp = None ) : #NEWLINE# #INDENT# 'generate auth token\n\n        :param token: a dict like ``{"id": user_id, ...}``\n        :param auth_exp: seconds of jwt token expiration time\n                         , default is ``self.auth_exp``\n        :return: string\n        ' #NEWLINE# if ( auth_exp is None ) : #NEWLINE# #INDENT# auth_exp = self . auth_exp #NEWLINE# #UNINDENT# token [ 'exp' ] = ( datetime . utcnow ( ) + timedelta ( seconds = auth_exp ) ) #NEWLINE# return jwt . encode ( token , self . auth_secret , algorithm = self . auth_alg )