<s> from logging import getLogger <EOL> from time import time <EOL> from turbulenz_local . controllers import BaseController <EOL> from turbulenz_local . decorators import jsonify <EOL> from turbulenz_local . models . userlist import get_current_user <EOL> import jwt <EOL> LOG = getLogger ( __name__ ) <EOL> class GameauthtokenController ( BaseController ) : <EOL> @ classmethod <EOL> @ jsonify <EOL> def game_auth_token ( cls , slug ) : <EOL> user = get_current_user ( ) <EOL> secret = slug <EOL> expTime = time ( ) + <NUM_LIT:3> * <NUM_LIT> <EOL> jwtPayload = jwt . encode ( { '<STR_LIT:username>' : user . username , '<STR_LIT>' : expTime } , secret ) <EOL> return { '<STR_LIT>' : True , '<STR_LIT:data>' : jwtPayload } </s>
