I am using the Flask-Dance package for logging in to my app via Github and I've configured it in my project but I get this error in response:
oauthlib.oauth2.rfc6749.errors.MismatchingStateError: (mismatching_state) CSRF Warning! State not equal in request and response.
What can I do ?
My code is:
github_bp = make_github_blueprint()
app.register_blueprint(github_bp, url_prefix="/login")
and
@app.route('/')
def github():
if not github.authorized:
return redirect(url_for('github.login'))
resp = github.get('/user')
assert resp.ok
login = resp.json()['login']
return f'You are {login} on GitHub'