def get_auth_token(): token = g.user.generate_auth_token(tokenLife) return jsonify({'token': token.decode('ascii'), 'duration': tokenLife})