aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db/users.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-07-24 15:15:09 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-07-24 15:15:42 +0200
commit33664eff2c93136658b7f863c95e1bfda91141ee (patch)
treeacda060d878b557e58db042a3bb30ff4212c17b1 /planetwars-server/src/db/users.rs
parent4a582e8079178a7ac11f2a492e7988fcdaa210cd (diff)
downloadplanetwars.dev-33664eff2c93136658b7f863c95e1bfda91141ee.tar.xz
planetwars.dev-33664eff2c93136658b7f863c95e1bfda91141ee.zip
basic user profile pages
Diffstat (limited to 'planetwars-server/src/db/users.rs')
-rw-r--r--planetwars-server/src/db/users.rs4
1 files changed, 2 insertions, 2 deletions
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::<User>(conn)
}
-pub fn find_user(username: &str, db_conn: &PgConnection) -> QueryResult<User> {
+pub fn find_user_by_name(username: &str, db_conn: &PgConnection) -> QueryResult<User> {
users::table
.filter(users::username.eq(username))
.first::<User>(db_conn)
}
pub fn authenticate_user(credentials: &Credentials, db_conn: &PgConnection) -> Option<User> {
- find_user(credentials.username, db_conn)
+ find_user_by_name(credentials.username, db_conn)
.optional()
.unwrap()
.and_then(|user| {