def post(self):
    args = self.parser.parse_args()
    user = User.query.filter_by(email=args['email']).first()
    if ((user is not None) and user.verify_password(args['password'])):
        token = generate_token(user)
        return jsonify({'token': token.decode('utf-8')})
    abort(400, message='Invalid credentials')
def post(self):
    args = self.parser.parse_args()
    user = User.query.filter_by(email=args['email']).first()
    if ((user is not None) and user.verify_password(args['password'])):
        token = generate_token(user)
        return jsonify({'token': token.decode('utf-8')})
    abort(400, message='Invalid credentials')