Closed ghost closed 1 year ago
The test for the Python Applications course https://graphacademy.neo4j.com/courses/app-python/2-interacting/5-registering/ will fail on this script for reasons outside the scope of the lesson. The root cause is the _generate_token() method.
_generate_token()
def _generate_token(self, payload): iat = datetime.utcnow() payload["sub"] = payload["userId"] payload["iat"] = iat payload["nbf"] = iat payload["exp"] = iat + current_app.config.get('JWT_EXPIRATION_DELTA') return jwt.encode( payload, self.jwt_secret, algorithm='HS256' ).decode('ascii')
The .decode('ascii') should be removed in the Main branch that users initially clone.
.decode('ascii')
Pull request opened for this issue: https://github.com/neo4j-graphacademy/app-python/pull/15
Thanks for spotting this. I have subsequently updated the code on all branches
The test for the Python Applications course https://graphacademy.neo4j.com/courses/app-python/2-interacting/5-registering/ will fail on this script for reasons outside the scope of the lesson. The root cause is the
_generate_token()
method.The
.decode('ascii')
should be removed in the Main branch that users initially clone.