def logout_view(): user_data = logout() if user_data is None: msg = 'No user to log out.' return render_template('logout.html', msg=msg) else: msg = 'Logged out user {0}.'.format(user_data['username']) return render_template('logout.html', msg=msg)
def logout_view(): user_data = logout() session.pop('username', None) if user_data is None: msg = 'No user to log out.' #return render_template('logout.html', msg=msg) return redirect(url_for('login')) else: msg = 'Logged out user {0}.'.format(user_data['username']) #return render_template('logout.html', msg=msg) return redirect(url_for('login'))
def view_logout(): logout() return redirect('/')
def logout_view(): # remove the username from the session if it's there user_data = logout() session.pop('username', None) flash('Logged out user {0}.'.format(user_data['username'])) return redirect(url_for('login'))