当前位置: 首页>>代码示例>>Python>>正文


Python current_user.generate_confirmation_token函数代码示例

本文整理汇总了Python中flask_login.current_user.generate_confirmation_token函数的典型用法代码示例。如果您正苦于以下问题:Python generate_confirmation_token函数的具体用法?Python generate_confirmation_token怎么用?Python generate_confirmation_token使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了generate_confirmation_token函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: resend_confirmation

def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_mail(current_user.email, 'Confirm your account',
              'auth/email/confirm', user=current_user, token=token)
    flash('A new confirmation email has been sent to {}.'.format(current_user.email))
    current_app.logger.info("A new confirmation email has been sent to {}.".format(current_user.email))
    return redirect(url_for('front_page.home_page'))
开发者ID:agmenut,项目名称:sabotage2_revamp,代码行数:7,代码来源:views.py

示例2: resend_confirmation

def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_email(current_user.email, 'Confirm Your Account',
               'auth/email/confirm', user = current_user, token=token)

    flash('A new confirmation email has been sent to you by email.')
    return redirect(url_for('main.index'))
开发者ID:tanny2015,项目名称:Blog_Flask,代码行数:7,代码来源:views.py

示例3: retry_confirm

def retry_confirm():
    if current_user.emailConfirmed:
        flash('Your email address has been confirmed.', 'success')
        return redirect(url_for('index'))
    token = current_user.generate_confirmation_token()
    message.send_email('Confirm Your Account', [current_user], 'confirmation', token=token)
    flash('A new confirmation email has been sent to you. Please check your spam or junk folder.', 'info')
    return redirect(url_for('index'))
开发者ID:brandonsato,项目名称:cbbpoll,代码行数:8,代码来源:views.py

示例4: resend_confirmation

def resend_confirmation():
    token = current_user.generate_confirmation_token()
    rendered_content = render_template(
                'auth/email/confirm.html', user=current_user, token=token)
    send_email.delay(
            current_user.email, u'确认注册'.encode('utf-8'), rendered_content)
    flash(u'新的确认注册链接已经发送到你的邮箱')
    return redirect(url_for('main.index'))
开发者ID:Infixz,项目名称:chengs.site,代码行数:8,代码来源:views.py

示例5: reconfirm

def reconfirm():
    '''重新发送邮箱认证'''
    if current_user.confirmed:
        return redirect(url_for('main.index'))
    else:
        token = current_user.generate_confirmation_token()
        send_email(current_user.email, u'注册账户邮箱认证', '/email/register.txt',
                   user=current_user, token=token)
        flash(u'注册邮箱认证邮件已发送至您的邮箱,请前去邮箱完成注册')
    return redirect(url_for('auth.login'))
开发者ID:Git-Hexin,项目名称:zhihuweb,代码行数:10,代码来源:views.py

示例6: resend_confirmation

def resend_confirmation():
    '''
    @note: 从新发送确认邮件
    '''
    token = current_user.generate_confirmation_token()

    send_email(current_user.email, 'Confirm Your Account',
               'auth/email/confirm', user=current_user, token=token)
    flash('通过电子邮件发送了一封新的确认电子邮件.','info')
    return redirect(url_for('main.index'))
开发者ID:guomaoqiu,项目名称:Flask_webdemo,代码行数:10,代码来源:views.py

示例7: resend_confirmation

def resend_confirmation():
    if not current_user.confirmed:
        token = current_user.generate_confirmation_token()
        send_email(current_user.email,
                   "Confirm Your Account",
                   'auth/email/confirm',
                   user=current_user,
                   token=token)
        flash("A new confirmation email has been sent")
    return redirect(url_for('main.index'))
开发者ID:Qumeric,项目名称:instabattle,代码行数:10,代码来源:views.py

示例8: resend_confirmation

def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_email(
        to=current_user.email,
        subject='Confirm your account',
        template='auth/email/confirm',
        user=current_user,
        token=token
    )
    flash('A new confirmation email has been sent to your email account.')
    return redirect(url_for('main.index'))
开发者ID:RodrigoVillatoro,项目名称:flask_social_network,代码行数:11,代码来源:views.py

示例9: change_email_request

def change_email_request():
    form = ChangeEmailForm()
    if form.validate_on_submit():
        new_email = form.email.data
        current_user.verify_password(form.password.data)
        token = current_user.generate_confirmation_token()
        send_email(new_email, "Confirm Your Account", "auth/email/change_email", user=current_user, token=token)
        flash("An email with instructions has been sent")
        return redirect(url_for("main.index"))
    else:
        flash("Invalid password")
    return render_template("auth/change_email.html", form=form)
开发者ID:abondar24,项目名称:FlaskBlogging,代码行数:12,代码来源:views.py

示例10: change_email_request

def change_email_request():
    form = ChangeEmailForm()
    if form.validate_on_submit():
        if current_user.verify_password(form.password.data):
            new_email = form.email.data
            token = current_user.generate_confirmation_token(new_email)
            send_email(new_email, '确认你的邮箱地址' \
                    'auth/email/change_email', \
                    user=current_user, token=token)
            flash('用于更改并确认新邮箱的邮件已发送至你的新邮箱。')
            return redirect(url_for('main.index'))
        else:
            flash('邮箱或密码不正确。')
    return render_template('auth/change_email.html', form=form)
开发者ID:wangrenlearn,项目名称:flask,代码行数:14,代码来源:views.py

示例11: confirm_request

def confirm_request():
    """Respond to new user's request to confirm their account."""
    token = current_user.generate_confirmation_token()
    confirm_link = url_for('account.confirm', token=token, _external=True)
    get_queue().enqueue(
        send_email,
        recipient=current_user.email,
        subject='Confirm Your Account',
        template='account/email/confirm',
        # current_user is a LocalProxy, we want the underlying user object
        user=current_user._get_current_object(),
        confirm_link=confirm_link)
    flash('A new confirmation link has been sent to {}.'.format(
        current_user.email), 'warning')
    return redirect(url_for('main.index'))
开发者ID:ColinHaley,项目名称:PTFMapper,代码行数:15,代码来源:views.py

示例12: resend_confirmation

def resend_confirmation():
    '''auth.resend_confirmation()'''
    token = current_user.generate_confirmation_token()
    send_email(
        recipient=current_user.email,
        subject='确认您的邮箱账户',
        template='auth/mail/confirm',
        user=current_user._get_current_object(),
        token=token
    )
    flash('一封新的确认邮件已经发送至您的邮箱', category='info')
    add_user_log(
        user=current_user._get_current_object(),
        event='请求重发邮箱确认邮件至:{}'.format(current_user.email),
        category='auth'
    )
    return redirect(url_for('auth.unconfirmed'))
开发者ID:Y-Lab,项目名称:Y-System,代码行数:17,代码来源:auth.py

示例13: resend_confirmation

def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_email(current_user.email, "Confirm Your Account", "/email/cnf", token=token)
    flash("Письмо с подтверждением высланно повторно.")
    return redirect("/events")
开发者ID:ZAS0RIN,项目名称:lbt,代码行数:5,代码来源:views.py

示例14: resend_confirmation

def resend_confirmation():
    token = current_user.generate_confirmation_token()
    send_email(current_user.email, u'确认账户',
               'auth/email/confirm', user=current_user, token=token)
    flash('一封确认邮件已经发送到你的邮箱.', "success")
    return redirect(url_for('main.index'))
开发者ID:StitchIQ,项目名称:dts_test,代码行数:6,代码来源:views.py

示例15: decorated_function

 def decorated_function(*args, **kwargs):
     if not current_user.confirmed:
         token = current_user.generate_confirmation_token()
         send_email([current_user.email], token=token)
         return render_template('auth/confirm_required.html')
     return fn(*args, **kwargs)
开发者ID:AlvinRenNo1,项目名称:clife,代码行数:6,代码来源:decorators.py


注:本文中的flask_login.current_user.generate_confirmation_token函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。