From 33664eff2c93136658b7f863c95e1bfda91141ee Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 24 Jul 2022 15:15:09 +0200 Subject: basic user profile pages --- planetwars-server/src/db/users.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'planetwars-server/src/db') diff --git a/planetwars-server/src/db/users.rs b/planetwars-server/src/db/users.rs index 3a74c53..1098204 100644 --- a/planetwars-server/src/db/users.rs +++ b/planetwars-server/src/db/users.rs @@ -57,14 +57,14 @@ pub fn create_user(credentials: &Credentials, conn: &PgConnection) -> QueryResul .get_result::(conn) } -pub fn find_user(username: &str, db_conn: &PgConnection) -> QueryResult { +pub fn find_user_by_name(username: &str, db_conn: &PgConnection) -> QueryResult { users::table .filter(users::username.eq(username)) .first::(db_conn) } pub fn authenticate_user(credentials: &Credentials, db_conn: &PgConnection) -> Option { - find_user(credentials.username, db_conn) + find_user_by_name(credentials.username, db_conn) .optional() .unwrap() .and_then(|user| { -- cgit v1.2.3