def sign_auth_path(next_path):
"""returns a URL-safe signed next_path"""
# next_path must start with a /
if not next_path.startswith('/'):
abort(503)
# sign the next_path
notary = itsdangerous.URLSafeSerializer(app.secret_key)
next_path_signed = notary.dumps(next_path)
return url_for('authenticate', next=next_path_signed)
评论列表
文章目录