From 241374350ad6c203d4546a2c906a9073f503f252 Mon Sep 17 00:00:00 2001 From: Jai A Date: Thu, 22 Aug 2024 14:29:03 -0500 Subject: [PATCH] run prep, fmt --- ...742ae3921c1f2067723ff13f06328debee3e.json} | 5 +- ...5238527ec210f20de13bd8995885159c6d277.json | 161 ------------------ ...e1866ec395146d5dabe071a13baa55ec3c09.json} | 10 +- ...f608166e1fa1f4ce5f655849874858d5f9e27.json | 33 ---- src/routes/internal/billing.rs | 2 +- src/routes/internal/flows.rs | 5 +- 6 files changed, 13 insertions(+), 203 deletions(-) rename .sqlx/{query-4005ccd3f0ed7d293e92931f75d3702a1c9d22dce353977b1c50b88d4417f240.json => query-55f7a2e7fa37697bbcd7031b2bff742ae3921c1f2067723ff13f06328debee3e.json} (69%) delete mode 100644 .sqlx/query-6a0ca2045bd91a27dce32c730cb5238527ec210f20de13bd8995885159c6d277.json rename .sqlx/{query-fed9fbeffd89652f539db8f2f361f2015e416d8d08a0af93c4ab865f74cd1518.json => query-93b8fff7ebe72e55e34e98bd365fe1866ec395146d5dabe071a13baa55ec3c09.json} (88%) delete mode 100644 .sqlx/query-c33fb3503d040fd91a049b10853f608166e1fa1f4ce5f655849874858d5f9e27.json diff --git a/.sqlx/query-4005ccd3f0ed7d293e92931f75d3702a1c9d22dce353977b1c50b88d4417f240.json b/.sqlx/query-55f7a2e7fa37697bbcd7031b2bff742ae3921c1f2067723ff13f06328debee3e.json similarity index 69% rename from .sqlx/query-4005ccd3f0ed7d293e92931f75d3702a1c9d22dce353977b1c50b88d4417f240.json rename to .sqlx/query-55f7a2e7fa37697bbcd7031b2bff742ae3921c1f2067723ff13f06328debee3e.json index 3ebdeae1..c55c2c37 100644 --- a/.sqlx/query-4005ccd3f0ed7d293e92931f75d3702a1c9d22dce353977b1c50b88d4417f240.json +++ b/.sqlx/query-55f7a2e7fa37697bbcd7031b2bff742ae3921c1f2067723ff13f06328debee3e.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n INSERT INTO users (\n id, username, email,\n avatar_url, bio, created,\n github_id, discord_id, gitlab_id, google_id, steam_id, microsoft_id,\n email_verified, password, paypal_id, paypal_country, paypal_email,\n venmo_handle\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7,\n $8, $9, $10, $11, $12, $13,\n $14, $15, $16, $17, $18\n )\n ", + "query": "\n INSERT INTO users (\n id, username, email,\n avatar_url, bio, created,\n github_id, discord_id, gitlab_id, google_id, steam_id, microsoft_id,\n email_verified, password, paypal_id, paypal_country, paypal_email,\n venmo_handle, stripe_customer_id\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7,\n $8, $9, $10, $11, $12, $13,\n $14, $15, $16, $17, $18, $19\n )\n ", "describe": { "columns": [], "parameters": { @@ -22,10 +22,11 @@ "Text", "Text", "Text", + "Text", "Text" ] }, "nullable": [] }, - "hash": "4005ccd3f0ed7d293e92931f75d3702a1c9d22dce353977b1c50b88d4417f240" + "hash": "55f7a2e7fa37697bbcd7031b2bff742ae3921c1f2067723ff13f06328debee3e" } diff --git a/.sqlx/query-6a0ca2045bd91a27dce32c730cb5238527ec210f20de13bd8995885159c6d277.json b/.sqlx/query-6a0ca2045bd91a27dce32c730cb5238527ec210f20de13bd8995885159c6d277.json deleted file mode 100644 index 759630e8..00000000 --- a/.sqlx/query-6a0ca2045bd91a27dce32c730cb5238527ec210f20de13bd8995885159c6d277.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT id, name, email,\n avatar_url, username, bio,\n created, role, badges,\n balance,\n github_id, discord_id, gitlab_id, google_id, steam_id, microsoft_id,\n email_verified, password, totp_secret, paypal_id, paypal_country, paypal_email,\n venmo_handle, stripe_customer_id\n FROM users\n WHERE id = ANY($1) OR LOWER(username) = ANY($2)\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "id", - "type_info": "Int8" - }, - { - "ordinal": 1, - "name": "name", - "type_info": "Varchar" - }, - { - "ordinal": 2, - "name": "email", - "type_info": "Varchar" - }, - { - "ordinal": 3, - "name": "avatar_url", - "type_info": "Varchar" - }, - { - "ordinal": 4, - "name": "username", - "type_info": "Varchar" - }, - { - "ordinal": 5, - "name": "bio", - "type_info": "Varchar" - }, - { - "ordinal": 6, - "name": "created", - "type_info": "Timestamptz" - }, - { - "ordinal": 7, - "name": "role", - "type_info": "Varchar" - }, - { - "ordinal": 8, - "name": "badges", - "type_info": "Int8" - }, - { - "ordinal": 9, - "name": "balance", - "type_info": "Numeric" - }, - { - "ordinal": 10, - "name": "github_id", - "type_info": "Int8" - }, - { - "ordinal": 11, - "name": "discord_id", - "type_info": "Int8" - }, - { - "ordinal": 12, - "name": "gitlab_id", - "type_info": "Int8" - }, - { - "ordinal": 13, - "name": "google_id", - "type_info": "Varchar" - }, - { - "ordinal": 14, - "name": "steam_id", - "type_info": "Int8" - }, - { - "ordinal": 15, - "name": "microsoft_id", - "type_info": "Varchar" - }, - { - "ordinal": 16, - "name": "email_verified", - "type_info": "Bool" - }, - { - "ordinal": 17, - "name": "password", - "type_info": "Text" - }, - { - "ordinal": 18, - "name": "totp_secret", - "type_info": "Varchar" - }, - { - "ordinal": 19, - "name": "paypal_id", - "type_info": "Text" - }, - { - "ordinal": 20, - "name": "paypal_country", - "type_info": "Text" - }, - { - "ordinal": 21, - "name": "paypal_email", - "type_info": "Text" - }, - { - "ordinal": 22, - "name": "venmo_handle", - "type_info": "Text" - }, - { - "ordinal": 23, - "name": "stripe_customer_id", - "type_info": "Text" - } - ], - "parameters": { - "Left": [ - "Int8Array", - "TextArray" - ] - }, - "nullable": [ - false, - true, - true, - true, - false, - true, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true, - false, - true, - true, - true, - true, - true, - true, - true - ] - }, - "hash": "6a0ca2045bd91a27dce32c730cb5238527ec210f20de13bd8995885159c6d277" -} diff --git a/.sqlx/query-fed9fbeffd89652f539db8f2f361f2015e416d8d08a0af93c4ab865f74cd1518.json b/.sqlx/query-93b8fff7ebe72e55e34e98bd365fe1866ec395146d5dabe071a13baa55ec3c09.json similarity index 88% rename from .sqlx/query-fed9fbeffd89652f539db8f2f361f2015e416d8d08a0af93c4ab865f74cd1518.json rename to .sqlx/query-93b8fff7ebe72e55e34e98bd365fe1866ec395146d5dabe071a13baa55ec3c09.json index 6328a48c..0589b26b 100644 --- a/.sqlx/query-fed9fbeffd89652f539db8f2f361f2015e416d8d08a0af93c4ab865f74cd1518.json +++ b/.sqlx/query-93b8fff7ebe72e55e34e98bd365fe1866ec395146d5dabe071a13baa55ec3c09.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT id, email,\n avatar_url, username, bio,\n created, role, badges,\n balance,\n github_id, discord_id, gitlab_id, google_id, steam_id, microsoft_id,\n email_verified, password, totp_secret, paypal_id, paypal_country, paypal_email,\n venmo_handle\n FROM users\n WHERE id = ANY($1) OR LOWER(username) = ANY($2)\n ", + "query": "\n SELECT id, email,\n avatar_url, username, bio,\n created, role, badges,\n balance,\n github_id, discord_id, gitlab_id, google_id, steam_id, microsoft_id,\n email_verified, password, totp_secret, paypal_id, paypal_country, paypal_email,\n venmo_handle, stripe_customer_id\n FROM users\n WHERE id = ANY($1) OR LOWER(username) = ANY($2)\n ", "describe": { "columns": [ { @@ -112,6 +112,11 @@ "ordinal": 21, "name": "venmo_handle", "type_info": "Text" + }, + { + "ordinal": 22, + "name": "stripe_customer_id", + "type_info": "Text" } ], "parameters": { @@ -142,8 +147,9 @@ true, true, true, + true, true ] }, - "hash": "fed9fbeffd89652f539db8f2f361f2015e416d8d08a0af93c4ab865f74cd1518" + "hash": "93b8fff7ebe72e55e34e98bd365fe1866ec395146d5dabe071a13baa55ec3c09" } diff --git a/.sqlx/query-c33fb3503d040fd91a049b10853f608166e1fa1f4ce5f655849874858d5f9e27.json b/.sqlx/query-c33fb3503d040fd91a049b10853f608166e1fa1f4ce5f655849874858d5f9e27.json deleted file mode 100644 index da480468..00000000 --- a/.sqlx/query-c33fb3503d040fd91a049b10853f608166e1fa1f4ce5f655849874858d5f9e27.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO users (\n id, username, name, email,\n avatar_url, bio, created,\n github_id, discord_id, gitlab_id, google_id, steam_id, microsoft_id,\n email_verified, password, paypal_id, paypal_country, paypal_email,\n venmo_handle, stripe_customer_id\n )\n VALUES (\n $1, $2, $3, $4, $5,\n $6, $7,\n $8, $9, $10, $11, $12, $13,\n $14, $15, $16, $17, $18, $19, $20\n )\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int8", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Varchar", - "Timestamptz", - "Int8", - "Int8", - "Int8", - "Varchar", - "Int8", - "Varchar", - "Bool", - "Text", - "Text", - "Text", - "Text", - "Text", - "Text" - ] - }, - "nullable": [] - }, - "hash": "c33fb3503d040fd91a049b10853f608166e1fa1f4ce5f655849874858d5f9e27" -} diff --git a/src/routes/internal/billing.rs b/src/routes/internal/billing.rs index 57a15956..877a5da8 100644 --- a/src/routes/internal/billing.rs +++ b/src/routes/internal/billing.rs @@ -999,7 +999,7 @@ pub async fn stripe_webhook( let price = match metadata.product_price.prices { Price::OneTime { price } => Some(price), Price::Recurring { intervals } => { - if let Some((subscription_id, interval)) = + if let Some((_subscription_id, interval)) = metadata.user_subscription_data { if let Some(mut user_subscription) = metadata.user_subscription { diff --git a/src/routes/internal/flows.rs b/src/routes/internal/flows.rs index d6549dd3..edf8f5b6 100644 --- a/src/routes/internal/flows.rs +++ b/src/routes/internal/flows.rs @@ -2055,10 +2055,7 @@ pub async fn change_password( let update_password = if let Some(new_password) = &change_password.new_password { let score = zxcvbn::zxcvbn( new_password, - &[ - &user.username, - &user.email.clone().unwrap_or_default(), - ], + &[&user.username, &user.email.clone().unwrap_or_default()], )?; if score.score() < 3 {