Esempio n. 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"
                    }
Esempio n. 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'))   
Esempio n. 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)
Esempio n. 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']))
Esempio n. 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
Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 9
0
 def tearDown(self):
     with self.app.test_request_context():
         logout()
Esempio n. 10
0
def logout():
  user_data = logout()
  if user_data is None:
    return abort(400)
  return "successfully logged out!"
Esempio n. 11
0
 def logmeout():
     logout()
     return redirect(url_for("login"))
Esempio n. 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'])
Esempio n. 13
0
 def logmeout():
     logout()
     session["next"] = None
     return render_template("auth/logout.html")
Esempio n. 14
0
def ulogout():
    logout()
    return redirect(url_for('index'))
Esempio n. 15
0
def signout():
    logout()
    print "logging out"
    return redirect("/")
Esempio n. 16
0
 def tearDown(self):
     with self.app.test_request_context():
         logout()
Esempio n. 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'])
Esempio n. 19
0
def signout():
    logout()
    print "logging out"
    return redirect("/")