title: I get jwt.exceptions.DecodeError: Invalid header padding
body: <p>So I have a simple flask app.
  Logging in creates a token:</p>
  <pre><code>token = jwt.encode({'user': token_data}, app.config['SECRET_KEY']).decode('utf-8')
  </code></pre>
  <p>The middleware looks like this:</p>
  <pre><code>def token_required(f):
      @wraps(f)
      def decorated(*args, **kwargs):
          data = request.headers['Authorization'].encode('ascii', 'ignore')
          token = str.replace(str(data), 'Bearer ', '')
          if not token:
              return jsonify({'message': 'Token is missing'}), 401
          data = jwt.decode(token, app.config['SECRET_KEY'], algorithms=['HS256'])['sub']
          return f(*args, **kwargs)
  
      return decorated
  </code></pre>
  <p>Then I run a protected route that is <code>@token_required</code> and get the error.
  <code>jwt.exceptions.DecodeError: Invalid header padding</code></p>
  <p>Can't add another utf-8 to the middleware token, as I cant use it with <code>str</code>
  What can I do?</p>