diff --git a/.sqlx/query-48fd98db66a68865babe4ac6a453de747bba2ce1da198dda4b6f3b78eacfebf3.json b/.sqlx/query-48fd98db66a68865babe4ac6a453de747bba2ce1da198dda4b6f3b78eacfebf3.json new file mode 100644 index 0000000..2619390 --- /dev/null +++ b/.sqlx/query-48fd98db66a68865babe4ac6a453de747bba2ce1da198dda4b6f3b78eacfebf3.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT username, email FROM users WHERE pid = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "username", + "type_info": "Varchar", + "origin": { + "Table": { + "table": "users", + "name": "username" + } + } + }, + { + "ordinal": 1, + "name": "email", + "type_info": "Varchar", + "origin": { + "Table": { + "table": "users", + "name": "email" + } + } + } + ], + "parameters": { + "Left": [ + "Int4" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "48fd98db66a68865babe4ac6a453de747bba2ce1da198dda4b6f3b78eacfebf3" +} diff --git a/.sqlx/query-6c276038b92bef06b30da32dab42256be431b361cfd36754aa41b6da220618cc.json b/.sqlx/query-6c276038b92bef06b30da32dab42256be431b361cfd36754aa41b6da220618cc.json new file mode 100644 index 0000000..1e5c7eb --- /dev/null +++ b/.sqlx/query-6c276038b92bef06b30da32dab42256be431b361cfd36754aa41b6da220618cc.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE users SET password = $1 WHERE pid = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "6c276038b92bef06b30da32dab42256be431b361cfd36754aa41b6da220618cc" +} diff --git a/src/nnid/support.rs b/src/nnid/support.rs index aa63349..aac67fc 100644 --- a/src/nnid/support.rs +++ b/src/nnid/support.rs @@ -200,15 +200,9 @@ pub async fn forgotten_password( let nintendo_hash = crate::account::account::generate_password(pid, &cleartext_password) .ok_or(UNAUTHORIZED_DEVICE_ERROR)?; - let hashed_password = bcrypt::hash(nintendo_hash, 10) - .map_err(|e| { - eprintln!("bcrypt error: {e}"); - UNAUTHORIZED_DEVICE_ERROR - })?; - let update_result = sqlx::query!( "UPDATE users SET password = $1 WHERE pid = $2", - hashed_password, + nintendo_hash, pid ) .execute(db)