Skip to content

Commit

Permalink
Show message for wrong user/password (closes #275)
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Jul 12, 2015
1 parent a692e3f commit e09aa6f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion rd_ui/app/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<link rel="stylesheet" href="/styles/redash.css">
<link rel="stylesheet" href="/styles/login.css">
<!-- endbuild -->

<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/images/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
</head>
<body>

Expand All @@ -26,13 +30,20 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/"><strong>{{name}}</strong></a>
<a class="navbar-brand" href="/"><img src="/images/redash_icon_small.png"/></a>
</div>
</div>
</nav>

<div class="container">
<div class="row">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-warning" role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}

<div class="main">
{% if show_google_openid %}
Expand Down
4 changes: 2 additions & 2 deletions redash/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import logging

from flask import render_template, send_from_directory, make_response, request, jsonify, redirect, \
session, url_for, current_app
session, url_for, current_app, flash
from flask.ext.restful import Resource, abort
from flask_login import current_user, login_user, logout_user, login_required
import sqlparse
Expand Down Expand Up @@ -80,7 +80,7 @@ def login():
login_user(user, remember=remember)
return redirect(request.args.get('next') or '/')
except models.User.DoesNotExist:
pass
flash("Wrong username or password.")

return render_template("login.html",
name=settings.NAME,
Expand Down

0 comments on commit e09aa6f

Please sign in to comment.