Esempio n. 1
0
File: auth.py Progetto: matoous/newz
def logout():
    """
    Logout current user
    :return:
    """
    current_user.logout()
    return redirect("/")
Esempio n. 2
0
def logout():
    logout = AuthClient().logout(current_user.ticket)
    if logout.status_code == 200:
        current_user.logout()
        logout_user()
        flash('Logged out successfully.', 'success')
        return redirect(url_for('auth.login'))
Esempio n. 3
0
def http_40x(message=None, category='danger', dest='auth.login'):
    try:
        current_user.logout()
    except Exception as e:
        raise e
    finally:
        flash(message, category)
        return redirect(url_for(dest))
Esempio n. 4
0
def logout():

    current_user.logout()
    logout_user()
    current_user.clear()

    flash('You have been logged out.')
    return redirect(url_for('test.index'))
Esempio n. 5
0
def logout():

    current_user.logout()
    logout_user()
    current_user.clear()

    flash('注销成功')
    return redirect(url_for('main.index'))
Esempio n. 6
0
def pre_request():
    try:
        if opt['VERBOSE']:
            print(session['uid'])
        current_user = User.get_by_id(session['uid'])
        if current_user.expired():
            current_user.logout()
            logout_user()
    except Exception, ex:
        if opt['VERBOSE']:
            print('User is anonymous.')
Esempio n. 7
0
def logout():
    try:
        current_user.logout()
        logged_out = logout_lit_review_user()
        if not logged_out:
            raise LogoutException('Logout unsuccessful. Reason unknown.')
        
        #Logout successful
        flash('Logged out.', 'login')
        
    except Exception as e:
        flash(e.message, 'error')
        
    return redirect(url_for("index"))
Esempio n. 8
0
def logout():
    log_it_info('logout', 'BEGIN')
    try:
        current_user.logout()
        logged_out = logout_lit_review_user()
        if not logged_out:
            raise LogoutException('Logout unsuccessful. Reason unknown.')
        
        #Logout successful
        flash('Logged out.', 'login')   
        log_it_info('logout', 'SUCCESS')
    except Exception as e:
        flash(e.message, 'error')
        log_it_info('logout', 'FAILURE')
        logging.error(e.message)
        
    return redirect(url_for("index"))
Esempio n. 9
0
def post_deactivate():
    pw_form = PasswordForm()
    email_form = EmailForm()
    email_form.fill(current_user)
    deactivate_form = DeactivateForm()

    if deactivate_form.validate(current_user):
        for feed in current_user.subscribed_feeds():
            current_user.unsubscribe(feed)
        User.destroy(current_user.id)
        current_user.logout()
        flash("You account was successfully deactivated", "success")
        redirect("/")

    return render_template(
        "settings-account.html",
        pw_form=pw_form,
        email_form=email_form,
        deactivate_form=deactivate_form,
    )
def dashboard():
    private_response = NodeClient().private_filelist(current_user.ticket)
    shared_response = NodeClient().shared_filelist(current_user.ticket)
    if private_response.status_code in [
            401, 403
    ] or shared_response.status_code in [401, 403]:
        current_user.logout()
        flash('Logged out due to inactivity. Please login again.', 'danger')
        return redirect(url_for('auth.login'))

    private_files = private_response.body
    shared_files = shared_response.body

    stats = {}
    stats['private_files'] = len(private_files['list']['entries'])
    stats['shared_files'] = len(shared_files['list']['entries'])
    js = render_template('dashboard/index.js')
    return render_template('dashboard/index.html',
                           user=current_user,
                           stats=stats,
                           title='Dashboard',
                           js=js)
Esempio n. 11
0
 def post(self):
     if current_user.is_authenticated:
         current_user.logout()
     return {}, 200
Esempio n. 12
0
 def logout(self):
     current_user.logout()
     return redirect(url_for('HomeView:index'))
Esempio n. 13
0
def logout():
    if current_user.is_authenticated and not current_user.is_anonymous:
        current_user.logout()
        logout_user()
    return redirect(url_for("search"))
Esempio n. 14
0
 def get(self):
     current_user.logout()
     #return redirect(request.args.get('next') or '/')
     return get_json(1, '登出成功', {})
Esempio n. 15
0
def logout():
    current_user.logout()
    return jsonify(success=True)
Esempio n. 16
0
def logout():
    current_user.logout()
    logout_user()
    return redirect(url_for('login.login'))
Esempio n. 17
0
File: api.py Progetto: cryptk/opsy
 def get(self):  # pylint: disable=no-self-use
     current_user.logout(current_app)
     return redirect(url_for('core_main.about'))
Esempio n. 18
0
def logout():
    current_user.logout()
    logout_user()
    return redirect(url_for('login_form', lang='en')), 302
Esempio n. 19
0
 def get(self):
     current_user.logout()
     return redirect(request.args.get('next') or '/')