Example #1
0
def cthlogout():
    logout()
    return redirect(url_for("login"))
    class Read(restful.Resource):
        def post(self):
            doc = request.get_json()
            posts = mongo.db.posts.find(doc["args"]).sort([("stamp", -1)]).limit(100)
            return {
                    "section": doc["section"],
                    "posts": "convert posts to json before you send them"
                    }
Example #2
0
def logout_view():
    user_data = logout()
    if user_data is None:
        flash(u'No user to log out.')
        return redirect(url_for('home'))
    flash(u'Logged out')
    return redirect(url_for('home'))   
Example #3
0
def user_logout():
    user_data = logout()
    if user_data is None:
        return redirect('/login')
    return render_template("logout.html",
                           username=user_data['username'],
                           app_state=app.app_state)
Example #4
0
def logout_view():
    user_data = logout()
    session.clear()
    if user_data is None:
        return render_template('logout.html', loggedout="nobody")
    return render_template('logout.html',
                           loggedout='{0}'.format(user_data['username']))
Example #5
0
 def test_logout(self):
     with self.app.test_request_context():
         login(self.user)
         user_data = logout()
         assert user_data["username"] == self.user.username
         assert session.get(SESSION_USER_KEY) is None
         assert session.get(SESSION_LOGIN_KEY) is None
Example #6
0
 def test_logout(self):
     with self.app.test_request_context():
         login(self.user)
         user_data = logout()
         assert user_data['username'] == self.user.username
         assert session.get(SESSION_USER_KEY) is None
         assert session.get(SESSION_LOGIN_KEY) is None
Example #7
0
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)
Example #8
0
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)
Example #9
0
 def tearDown(self):
     with self.app.test_request_context():
         logout()
Example #10
0
def logout():
  user_data = logout()
  if user_data is None:
    return abort(400)
  return "successfully logged out!"
Example #11
0
 def logmeout():
     logout()
     return redirect(url_for("login"))
Example #12
0
def logout_view():
    user_data = logout()
    if user_data is None:
        return 'No user to log out.'
    return 'Logged out user {0}.'.format(user_data['username'])
Example #13
0
 def logmeout():
     logout()
     session["next"] = None
     return render_template("auth/logout.html")
Example #14
0
def ulogout():
    logout()
    return redirect(url_for('index'))
Example #15
0
def signout():
    logout()
    print "logging out"
    return redirect("/")
Example #16
0
 def tearDown(self):
     with self.app.test_request_context():
         logout()
Example #17
0
def logoff():
    logout()
    return flask.redirect('/static/index.html') #TODO change url
def logout_view():
    user_data = logout()
    if user_data is None:
        return 'No user to log out.'
    return 'Logged out user {0}.'.format(user_data['username'])
Example #19
0
def signout():
    logout()
    print "logging out"
    return redirect("/")