Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Make SECURITY_POST_LOGIN_VIEW work when 'next' is blank #261

Closed
wants to merge 3 commits into from

Conversation

danpat
Copy link

@danpat danpat commented Jun 6, 2014

If a user goes directly to /login, the value of 'next' is the empty string in the login form.
This change updates validate_redirect_url() so that the empty string does not validate, and get_post_action_redirect() will fall through as expected to SECURITY_POST_LOGIN_VIEW.

If a user goes directly to /login, the value of 'next' is the empty string in the login form.
This change updates validate_redirect_url() so that the empty string does not validate, and get_post_action_redirect() will fall through as expected to SECURITY_POST_LOGIN_VIEW.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 07b9caf on danpat:develop into faa9f65 on mattupstate:develop.

My new Mac OS 10.9 system doesn't include "mock", and it's required for the test suite to run.
Additional code is required to properly initalize pytest-cache when it's installed into a local egg in the current working directory.

Fix from here:

    https://bitbucket.org/hpk42/pytest-cache/issue/8/pytest-cache-plugin-not-loading-when-using

Without this, I get:
.....
running build_ext
usage: setup.py [options] [file_or_dir] [file_or_dir] [...]
setup.py: error: unrecognized arguments: --clearcache
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 55863b8 on danpat:develop into faa9f65 on mattupstate:develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 76299a5 on danpat:develop into faa9f65 on mattupstate:develop.

@mattupstate
Copy link
Collaborator

@danpat Thanks for catching this, this is clearly an issue, however I'm not too keen on the testing changes you've made. I don't see why mock is need nor do I see why I should change setup.py to work with your environment.

danpat pushed a commit to danpat/flask-security that referenced this pull request Oct 5, 2014
galeo pushed a commit to galeo/flask-security-outdated that referenced this pull request Mar 4, 2020
Continued integrating unified sign in into other features.

We use an un-guessable password (not an empty) one in the user DB record - this makes sure
we don't let folks log in w/o any password, and keeps the DB Column definition of 'non-null' the same.

Added "password" explicitly as a US_ENABLED_METHODS - this actually allows an admin to NOT allow password login - or to JUST use passwords with this new endpoint.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants