Compare commits
3 Commits
2f12824fdc
...
b0d25b2f3c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0d25b2f3c | ||
| 737982ac20 | |||
| 9543dd78cf |
@ -71,7 +71,9 @@ pub async fn login(
|
|||||||
let req = request.into_inner();
|
let req = request.into_inner();
|
||||||
let users = user_list.lock().await;
|
let users = user_list.lock().await;
|
||||||
|
|
||||||
if let Some(user) = users.iter().find(|u| u.person.name == req.username)
|
if let Some(user) = users
|
||||||
|
.iter()
|
||||||
|
.find(|u| u.person.name.to_lowercase() == req.username.to_lowercase())
|
||||||
&& bcrypt::verify(&req.password, &user.password_hash).unwrap_or(false)
|
&& bcrypt::verify(&req.password, &user.password_hash).unwrap_or(false)
|
||||||
{
|
{
|
||||||
let token = Uuid::new_v4().to_string();
|
let token = Uuid::new_v4().to_string();
|
||||||
|
|||||||
@ -78,14 +78,14 @@ async fn add_game(
|
|||||||
let mut games = game_list.lock().await;
|
let mut games = game_list.lock().await;
|
||||||
let mut game = game.into_inner();
|
let mut game = game.into_inner();
|
||||||
|
|
||||||
if games.iter().any(|g| {
|
game.title = game.title.trim().to_string();
|
||||||
|
|
||||||
|
if let Some(existing) = games.iter().find(|g| {
|
||||||
g.title == game.title || (g.remote_id == game.remote_id && g.source == game.source)
|
g.title == game.title || (g.remote_id == game.remote_id && g.source == game.source)
|
||||||
}) {
|
}) {
|
||||||
return None;
|
return Some(existing.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
game.title = game.title.trim().to_string();
|
|
||||||
|
|
||||||
games.push(game.clone());
|
games.push(game.clone());
|
||||||
|
|
||||||
games.sort_unstable_by(|g1, g2| g1.title.cmp(&g2.title));
|
games.sort_unstable_by(|g1, g2| g1.title.cmp(&g2.title));
|
||||||
|
|||||||
10
frontend/pnpm-lock.yaml
generated
10
frontend/pnpm-lock.yaml
generated
@ -47,7 +47,7 @@ importers:
|
|||||||
version: 7.0.1(eslint@9.39.1)
|
version: 7.0.1(eslint@9.39.1)
|
||||||
eslint-plugin-react-refresh:
|
eslint-plugin-react-refresh:
|
||||||
specifier: ^0.4.24
|
specifier: ^0.4.24
|
||||||
version: 0.4.24(eslint@9.39.1)
|
version: 0.4.26(eslint@9.39.1)
|
||||||
globals:
|
globals:
|
||||||
specifier: ^16.5.0
|
specifier: ^16.5.0
|
||||||
version: 16.5.0
|
version: 16.5.0
|
||||||
@ -425,7 +425,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==}
|
resolution: {integrity: sha512-EcA07pHJouywpzsoTUqNh5NwGayl2PPVEJKUSinGGSxFGYn+shYbqMGBg6FXDqgXum9Ou/ecb+411ssw8HImJQ==}
|
||||||
engines: {node: ^20.19.0 || >=22.12.0}
|
engines: {node: ^20.19.0 || >=22.12.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0
|
vite: npm:rolldown-vite@7.2.5
|
||||||
|
|
||||||
acorn-jsx@5.3.2:
|
acorn-jsx@5.3.2:
|
||||||
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
||||||
@ -545,8 +545,8 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0
|
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0
|
||||||
|
|
||||||
eslint-plugin-react-refresh@0.4.24:
|
eslint-plugin-react-refresh@0.4.26:
|
||||||
resolution: {integrity: sha512-nLHIW7TEq3aLrEYWpVaJ1dRgFR+wLDPN8e8FpYAql/bMV2oBEfC37K0gLEGgv9fy66juNShSMV8OkTqzltcG/w==}
|
resolution: {integrity: sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: '>=8.40'
|
eslint: '>=8.40'
|
||||||
|
|
||||||
@ -1568,7 +1568,7 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
eslint-plugin-react-refresh@0.4.24(eslint@9.39.1):
|
eslint-plugin-react-refresh@0.4.26(eslint@9.39.1):
|
||||||
dependencies:
|
dependencies:
|
||||||
eslint: 9.39.1
|
eslint: 9.39.1
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user