def regiester_page(): try: token = request.args.get("token") email = get_email_from_token(token) if email == False: return render_template("error.html", message="没有权限") if not token_verify(db, token): return render_template("error.html", message="网址已过期") except Exception: return render_template("error.html", message="没有权限") return render_template("register.html", email=email, token=token)
def password_resetter_page(): try: token = request.args.get("token") email = get_email_from_token(token) user = User.load_from_email(db, email) if email == False: return render_template("error.html", message="没有权限") if not token_verify(db, token): return render_template("error.html", message="网址已过期") except Exception: return render_template("error.html", message="没有权限") return render_template("password_resetter.html", token=token, user_id=user.user_id)
def confirm_page(): try: token = request.args.get("token") email = get_email_from_token(token) if email == False or current_user.user_id == -1: return render_template("error.html", message="没有权限") if not token_verify(db, token): return render_template("error.html", message="网址已过期") except Exception: return render_template("error.html", message="没有权限") current_user.update("email", email) return render_template("user_setting.html", target_user=current_user, updated=True)