def reset_password(code): if not current_user.is_anonymous: flash('You must be logged out to reset your password', 'warning') return redirect(url_for("dashboard_home.index")) try: email = token.decode(code, salt=constants.PASSWORD_RESET_SALT) except Exception: email = None if not email: return abort(403) form = ChangePasswordForm() if form.validate_on_submit(): user = User.query.filter_by(email=email).one() user.password = form.password.data db.session.commit() login_user(user) flash("Changed your password succesfully", "success") return redirect( request.args.get("next") or url_for("dashboard_home.index")) return render_template("auth/reset_password.html", form=form)
def change_password(): form = ChangePasswordForm() if form.validate_on_submit(): current_user.set_password(form.password.data) db.session.commit() flash("Changed password", "success") else: form = ChangePasswordForm() return render_template('/settings/change_password.html', form=form)
def change_password(): form = ChangePasswordForm() if form.validate_on_submit(): current_user.password = form.password.data db.session.commit() flash("Changed password", "success") else: flash("The password was invalid", "warning") return redirect(url_for("dashboard_settings.index"))
def settings(): # TODO: Implement @fresh_login_required for non-oauthed users (users with a password) form = ChangePasswordForm() return render_template('dashboard/settings.html', form=form)
def team(): form = ChangePasswordForm() membership = current_membership() team = membership.team return render_template('dashboard/team.html', form=form, team=team)