예제 #1
0
def confirm(token):
    if current_user.confirm:
        return redirect(url_for('main.index'))
    if current_user.confirm_token(token):
        flash('You have confirmed your account successfully.')
    else:
        flash('verification failed.')
    return redirect(url_for('main.index'))
예제 #2
0
파일: views.py 프로젝트: AlbertE1990/my_bbs
def confirm(token):
    if current_user.confirm:
        flash('账户已经确认,无需重复确认,谢谢!')
    if current_user.confirm_token(token):
        flash('账户确认成功,谢谢!')
        db.session.commit()
    else:
        flash('账户确认链接失效,请从前发送链接')
    return redirect(url_for('.middle'))
예제 #3
0
def confirm(token):
    if current_user.confirmed():
        return redirect(url_for('main.index'))
    if current_user.confirm_token(token):
        db.session.commit()
        flash('Congratulations! You have successfully confirmed your account')
    else:
        flash('Your confirmation link is expired')
    return redirect(url_for('main.index'))
예제 #4
0
파일: views.py 프로젝트: Git-Hexin/zhihuweb
def confirm(token):
    if current_user.confirmed:
        return redirect(url_for('main.index'))
    if current_user.confirm_token(token):
        flash(u'完成邮箱认证')
    else:
        flash(u"邮箱认证链接已经失效")
        return redirect(url_for('auth.unconfirmed'))
    return redirect(url_for('main.index'))
예제 #5
0
def confirm(token):
    if current_user.confirmed:
        return redirect(url_for('main.index'))
    if current_user.confirm_token(token):
        flash(u'认证成功!')
    else:
        flash(u'认证失败!')

    return redirect(url_for('main.index'))
예제 #6
0
파일: views.py 프로젝트: Sablier/Microblog
def confirm(token):
    if current_user.confirmed:
        return redirect(url_for('index'))
    if current_user.confirm_token(token):
        flash('We have confirmed your account. Thanks!')
        return redirect(url_for('index'))
    else:
        flash('The confirmation link is invalid or has expired.')
        return redirect(url_for('index'))
예제 #7
0
def email_confirmation(token):
    if current_user.confirmed:
        flash('Email already confirmed!')
        return redirect(url_for('main.index'))
    else:
        if current_user.confirm_token(token):
            flash('Your email confirmed successfully!')
        else:
            flash('Invalid or expired token!')
        return redirect(url_for('main.index'))
예제 #8
0
def confirm_token(token):
    if current_user.is_confirmed:
        flash('Account already confirmed', 'primary')
        return redirect(url_for('main.home'))
    else:
        if current_user.confirm_token(token):
            db.session.commit()
            flash('Account confirmed successfully!', 'success')
        else:
            flash('Error validating the user. Try again later', 'danger')
    return redirect(url_for('main.home'))
예제 #9
0
def confirm(token):

    if current_user.is_email_confirmed:
        flash(notify_warning("Account already confirmed."))
        return redirect(url_for("dashboard.index"))

    if current_user.confirm_token(token):
        flash(notify_success("You have confirmed your account. Thanks!"))
        return redirect(url_for("dashboard.index"))

    flash(notify_warning("The confirmation link is invalid/expired."))
    return redirect(url_for("auth.unconfirmed"))
예제 #10
0
파일: views.py 프로젝트: dariokl/porez_app
def account_confirm(token):
    """ 
    Server side token checking , we use confirm_token to read the token data and change user.is_confirmed to True
    and make the database changes
    """

    # Current_user can only be a logged in user because we set the @login_required decorator and if the current user is
    # confirmed we just redirect him to the index page.
    if current_user.is_confirmed:
        return redirect(url_for('core.index'))

    if current_user.confirm_token(token):
        # Checking the data inside the token with .confirm_token method from user class
        db.session.commit()
        flash('Uspješno ste potvrdili Vašu email adresu')
    else:
        flash('Vaš zahtjev nije validan !')

    return redirect(url_for('core.index'))
예제 #11
0
파일: user.py 프로젝트: KTachibanaM/Albireo
def get_confirm_email():
    data = json.loads(request.get_data(as_text=True))
    token = data.get('token')
    if token is None:
        raise ClientError('Invalid Token')
    return current_user.confirm_token(token)
예제 #12
0
파일: user.py 프로젝트: ykelvis/Albireo
def get_confirm_email():
    data = json.loads(request.get_data(as_text=True))
    token = data.get('token')
    if token is None:
        raise ClientError('Invalid Token')
    return current_user.confirm_token(token)