def login(): if session.get('logged_in'): return redirect(url_for('rdr')) un = request.form.get('username') pw = request.form.get('password') if not un or not pw: abort(401) user = users.find_one({'name':un}) if not user: abort(401) # XXX: need to replace this with a real secret key if not bcrypt.check_password_hash(user['password'], pw): abort(401) # else we're clear session['logged_in'] = True return redirect(url_for('feeds'))
def feeds(): if not session.get('logged_in'): return redirect(url_for('splash')) return render_template('rdr.html')
def splash(): if session.get('logged_in') == True: return redirect(url_for('rdr')) return render_template('splash.html')