mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Merge branch 'master' into offline
* master: Enforcing user agents for windows client apps. Showing username on blocked api logins.
This commit is contained in:
commit
be5c9fe389
1 changed files with 2 additions and 2 deletions
|
@ -25,9 +25,9 @@ def login(request):
|
||||||
errors = None
|
errors = None
|
||||||
user_agent = request.environ.get('HTTP_USER_AGENT', '')
|
user_agent = request.environ.get('HTTP_USER_AGENT', '')
|
||||||
|
|
||||||
if not user_agent:
|
if not user_agent or user_agent.lower() in ['nativehost']:
|
||||||
errors = dict(user_agent="You must set a user agent to login.")
|
errors = dict(user_agent="You must set a user agent to login.")
|
||||||
logging.user(request, "~FG~BB~SK~FRBlocked ~FGAPI Login~SN~FW: %s" % user_agent)
|
logging.user(request, "~FG~BB~SK~FRBlocked ~FGAPI Login (%s)~SN~FW: %s" % (request.REQUEST.get('username', ''), user_agent))
|
||||||
elif request.method == "POST":
|
elif request.method == "POST":
|
||||||
form = LoginForm(data=request.POST)
|
form = LoginForm(data=request.POST)
|
||||||
if form.errors:
|
if form.errors:
|
||||||
|
|
Loading…
Add table
Reference in a new issue