Compare commits
No commits in common. "a7a50619f3946da5a87006f98dd3625bb9b9c1ae" and "e72527c473db72d70bfb8678b4877d14fb8a7cef" have entirely different histories.
a7a50619f3
...
e72527c473
@ -745,15 +745,7 @@ def register(app) -> None:
|
||||
try:
|
||||
with connect() as conn:
|
||||
row = conn.execute(
|
||||
"""
|
||||
SELECT status,
|
||||
username,
|
||||
initial_password,
|
||||
initial_password_revealed_at,
|
||||
email_verified_at
|
||||
FROM access_requests
|
||||
WHERE request_code = %s
|
||||
""",
|
||||
"SELECT status, username, initial_password, initial_password_revealed_at FROM access_requests WHERE request_code = %s",
|
||||
(code,),
|
||||
).fetchone()
|
||||
if not row:
|
||||
@ -765,15 +757,7 @@ def register(app) -> None:
|
||||
except Exception:
|
||||
pass
|
||||
row = conn.execute(
|
||||
"""
|
||||
SELECT status,
|
||||
username,
|
||||
initial_password,
|
||||
initial_password_revealed_at,
|
||||
email_verified_at
|
||||
FROM access_requests
|
||||
WHERE request_code = %s
|
||||
""",
|
||||
"SELECT status, username, initial_password, initial_password_revealed_at FROM access_requests WHERE request_code = %s",
|
||||
(code,),
|
||||
).fetchone()
|
||||
if not row:
|
||||
@ -784,7 +768,6 @@ def register(app) -> None:
|
||||
"ok": True,
|
||||
"status": status,
|
||||
"username": row.get("username") or "",
|
||||
"email_verified": bool(row.get("email_verified_at")),
|
||||
}
|
||||
task_rows = conn.execute(
|
||||
"""
|
||||
|
||||
@ -206,23 +206,3 @@ class AccessRequestTests(TestCase):
|
||||
resp = self.client.get(f"/api/access/request/verify-link?code=alice~CODE123&token={token}")
|
||||
self.assertEqual(resp.status_code, 302)
|
||||
self.assertIn("verified=1", resp.headers.get("Location", ""))
|
||||
|
||||
def test_status_includes_email_verified(self):
|
||||
rows = {
|
||||
"SELECT status": {
|
||||
"status": "pending",
|
||||
"username": "alice",
|
||||
"initial_password": None,
|
||||
"initial_password_revealed_at": None,
|
||||
"email_verified_at": ar.datetime.now(ar.timezone.utc),
|
||||
}
|
||||
}
|
||||
with mock.patch.object(ar, "connect", lambda: dummy_connect(rows)):
|
||||
resp = self.client.post(
|
||||
"/api/access/request/status",
|
||||
data=json.dumps({"request_code": "alice~CODE123"}),
|
||||
content_type="application/json",
|
||||
)
|
||||
data = resp.get_json()
|
||||
self.assertEqual(resp.status_code, 200)
|
||||
self.assertTrue(data.get("email_verified"))
|
||||
|
||||
@ -442,7 +442,6 @@ async function copyRequestCode() {
|
||||
async function checkStatus() {
|
||||
if (checking.value) return;
|
||||
error.value = "";
|
||||
verifyMessage.value = "";
|
||||
const trimmed = statusForm.request_code.trim();
|
||||
if (!trimmed) return;
|
||||
if (!trimmed.includes("~")) {
|
||||
@ -467,9 +466,6 @@ async function checkStatus() {
|
||||
onboardingUrl.value = data.onboarding_url || "";
|
||||
tasks.value = Array.isArray(data.tasks) ? data.tasks : [];
|
||||
blocked.value = Boolean(data.blocked);
|
||||
if (data.email_verified) {
|
||||
verifyMessage.value = "Email confirmed.";
|
||||
}
|
||||
} catch (err) {
|
||||
error.value = err.message || "Failed to check status";
|
||||
status.value = "unknown";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user