forked from weibeu/Flask-Discord
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
My code
@app.route('/callback')
async def callback():
logger.info("1")
try:
logger.info("2")
if await discord.authorized:
logger.info("3")
return redirect(url_for('index'))
logger.info("4")
await discord.callback()
logger.info("5")
next_url = session.pop('next_url', '/')
logger.info("6")
return redirect(next_url)
except AccessDenied as e:
logger.info("7")
return await render_template('auth_cancel.html')
except DecodeError as e:
logger.info(f"callback() error: {e}")
return await render_template("use_normal_browser.html")
@app.errorhandler(Unauthorized)
async def redirect_unauthorized(e):
session['next_url'] = request.url
return await discord.create_session()(loggers for debug)
Im getting:
2023-03-19 06:32:41,148 - LOGGER - INFO - 1
2023-03-19 06:32:41,149 - LOGGER - INFO - 2
2023-03-19 06:32:41,149 - LOGGER - INFO - 4
2023-03-19 06:32:41,149 - LOGGER - INFO - Some error: (mismatching_state) CSRF Warning! State not equal in request and response.
Metadata
Metadata
Assignees
Labels
No labels