Exemple #1
0
def reset_request():
	if current_user.is_authenticated:
		return redirect(url_for('main.home'))
	form = RequestResetForm()
	if form.validate_on_submit():
		user = User.query.filter_by(email=form.email.data).first()
		send_reset_email(user)
		flash('An Email has been sent with instructions for reset', 'info')
	return render_template('reset_request.html', title='Reset Password', form=form)
Exemple #2
0
def reset_request():
    if(current_user.is_authenticated):
        return redirect(url_for('main.home'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash('reset email sent', 'info')
        return redirect(url_for('users.login'))
    return render_template('reset_request.html', title='Reset Password', form=form)
Exemple #3
0
def reset_request():
	if current_user.is_authenticated:
		return redirect(url_for('main.home'))
	form = RequestResetForm()
	if form.validate_on_submit():
		user = User.query.filter_by(email=form.email.data).first()
		send_reset_email(user)
		flash("An email has been sent with instructions to reset your password. Please be sure to check the spam folder.","info")
		return redirect(url_for('users.login'))
	return render_template('reset_request.html', title='Reset Password', form=form)
Exemple #4
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.home'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash("The email has been sent to your email id", "info")
        return redirect(url_for('users.login'))
    return render_template("reset_request.html",
                           title="Reset Password",
                           form=form)
Exemple #5
0
def request_password():
    if current_user.is_authenticated:
        return redirect(url_for('main.home'))
    form = RequestResetForm()

    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_email(user)
        flash('An email has been sent to the registered email id.\n'
              + 'Please check the email for more details. ', 'info')
        return redirect(url_for('users.login'))
    return render_template('request_reset_pwd.html', form=form, title='Request Password Reset')
Exemple #6
0
def reset_request():
    if current_user.is_authenticated:
        flash('You are already logged in!', 'warning')
        return redirect(url_for('main.index'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash('An email has been sent with instructions', 'info')
        return redirect(url_for('users.login'))
    return render_template('reset_request.html',
                           title='Reset Password',
                           form=form)
Exemple #7
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for("main.home"))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash(
            "An Email has been sent with instructions to reset your password.",
            "info")
        return redirect(url_for("users.login"))
    return render_template("reset_request.html",
                           title="Reset Password",
                           form=form)
Exemple #8
0
def reset_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.home'))
    else:
        form = RequestResetForm()
        if form.validate_on_submit():
            user = User.query.filter_by(email=form.email.data).first()
            send_reset_email(user)
            flash(
                message=f"Password reset instruction sent to {form.email.data}",
                category='info')
            redirect(url_for('users.login'))
        return render_template('reset_request.html',
                               title='Verify Username',
                               form=form)
Exemple #9
0
def reset_request(
):  # route where a user/person enters there email to request a password reset
    if current_user.is_authenticated:
        return redirect(url_for('main.home'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash(
            f'An email has been sent with instructions to reset your password',
            'info')
        return redirect(url_for('users.login'))
    return render_template('reset_request.html',
                           title='Reset Password',
                           form=form)
Exemple #10
0
def reset_request():
    if current_user.is_authenticated:
        flash(f'Please sign out before!', 'warning')
        return redirect(url_for('main.home'))
    form = RequestResetForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash(
            f'An email has been sent with instructions to reset your password.',
            'info')
        return redirect(url_for('users.signin'))
    return render_template('reset_request.html',
                           title='Reset Password',
                           form=form)
Exemple #11
0
def reset_request():
    # if the user is logged in then there's no need for a password reset
    # redirect them to the home page
    if current_user.is_authenticated:
        return redirect(url_for('main.home'))

    # grab the form we want to show
    form = RequestResetForm()

    # grab our user by email
    # send them an email
    # redirect them to login
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        send_reset_email(user)
        flash("An email has been sent with instructions to reset password",
              "info")
        return redirect(url_for('users.login'))
    return render_template('reset_request.html',
                           title='Reset Password',
                           form=form)