~fnux/meta.sr.ht

9e93688263579e930b0b2810c5039e6463b5df36 — Drew DeVault 7 months ago 1bd094b 0.51.0
Improve email change UX
M metasrht/blueprints/profile.py => metasrht/blueprints/profile.py +5 -2
@@ 1,5 1,5 @@
from flask import Blueprint, Response, render_template, request, abort
from flask import redirect, url_for
from flask import redirect, url_for, session
from metasrht.blueprints.auth import validate_email
from metasrht.types import User, UserAuthFactor, FactorType
from srht.config import cfg


@@ 32,7 32,8 @@ def user_pgp_keys_GET(username):
@profile.route("/profile")
@loginrequired
def profile_GET():
    return render_template("profile.html")
    notice = session.pop("notice", None)
    return render_template("profile.html", notice=notice)

@profile.route("/profile", methods=["POST"])
@loginrequired


@@ 53,4 54,6 @@ def profile_POST():

    db.session.commit()
    login_user(user, set_cookie=True)
    if new_email:
        session["notice"] = "An email has been sent to your new address. Check your inbox to complete the change."
    return redirect(url_for(".profile_GET"))

M metasrht/templates/profile.html => metasrht/templates/profile.html +5 -1
@@ 4,8 4,12 @@
{% endblock %}
{% block content %}
<div class="row">
  <div class="col-lg-6">
  <div class="col-lg-12">
    <h3>User Profile</h3>
  </div>
</div>
<div class="row">
  <div class="col-lg-6">
    <form method="POST" action="/profile">
      {{csrf_token()}}
      <div class="form-group">

M metasrht/templates/registered.html => metasrht/templates/registered.html +1 -1
@@ 4,7 4,7 @@
{% endblock %}
{% block content %}
<div class="row">
  <div class="col-md-8">
  <div class="col-md-12">
    <h3>
      Check your email
    </h3>