question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs: one link in "Login Exemple" is dead

See original GitHub issue

In index.rst there is a dead link

Login Example
=============

Once a user has authenticated, you log them in with the `login_user`
function.

    For example:


.. code-block:: python

    @app.route('/login', methods=['GET', 'POST'])
    def login():
        # Here we use a class of some kind to represent and validate our
        # client-side form data. For example, WTForms is a library that will
        # handle this for us, and we use a custom LoginForm to validate.
        form = LoginForm()
        if form.validate_on_submit():
            # Login and validate the user.
            # user should be an instance of your `User` class
            login_user(user)

            flask.flash('Logged in successfully.')

            next = flask.request.args.get('next')
            # is_safe_url should check if the url is safe for redirects.
            # See http://flask.pocoo.org/snippets/62/ for an example.
            if not is_safe_url(next):
                return flask.abort(400)

            return flask.redirect(next or flask.url_for('index'))
        return flask.render_template('login.html', form=form)

image


The link http://flask.pocoo.org/snippets/62/ is not working.

Desktop (please complete the following information):

  • OS: Linux mint
  • Browser: Vivaldi (chrome based)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
YKdvdcommented, Dec 22, 2020

Someone extracted an is_url_safe() from Django awhile back and packaged it up as a standalone PyPi project: https://pypi.org/project/is-safe-url It might be something to consider pointing at in the docs? https://gitlab.com/MarkusH/is_safe_url/-/blob/master/is_safe_url.py

Also, https://flask-login.readthedocs.io/en/latest/ hasn’t been updated with docs from 0.5.0.

1reaction
davevanfleetcommented, Oct 1, 2020

Here’s the most recent archive from Wayback Machine. http://web.archive.org/web/20190524230221/http://flask.pocoo.org/snippets/62/
It looks like it’s not up to date with Python 3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Docs shared link requires login to edit document [closed]
The culprit is the invite=xyZFOO parameter in the URL. If it is deleted and the resulting URL opened, it works (the Docs is...
Read more >
Submit a request regarding a deceased user's account
We cannot provide passwords or other login details. Any decision to satisfy a request about a deceased user will be made only after...
Read more >
How to use google spreadsheets to check for broken links
Usually, this is a very simple task. All I would have to do is click the link in the URL column and see...
Read more >
Sign In With Google JavaScript API reference | Authentication
This reference page describes the Sign-In JavaScript API. You can use this API to display the One Tap prompt or Sign In With...
Read more >
25 incredibly useful Google Docs tips and tricks - Fast Company
(This one is also available in the Docs mobile apps; just look for the ... You can also add an image from your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found