import jwt


def generate_jwt(user_id):
    encoded = jwt.encode({'user_id': user_id}, 'secret', algorithm='HS256')
    return encoded.decode()


def decode_jwt(jwt_token):
    return jwt.decode(jwt_token, 'secret', algorithms=['HS256'])
