aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/bin
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-28 22:50:47 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-28 22:50:47 -0800
commit156b10220a50f6f441e7484235e227316f26761e (patch)
tree316ccf3a5081b7b43f2a570173d52818acab58f2 /rust/src/bin
parentd50f7729cbc86c62dba9bd4db80786f07b44a7c0 (diff)
downloadfatcat-156b10220a50f6f441e7484235e227316f26761e.tar.gz
fatcat-156b10220a50f6f441e7484235e227316f26761e.zip
basic auth unittests
Diffstat (limited to 'rust/src/bin')
-rw-r--r--rust/src/bin/fatcat-auth.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/rust/src/bin/fatcat-auth.rs b/rust/src/bin/fatcat-auth.rs
index 4b90da74..5a8f0f98 100644
--- a/rust/src/bin/fatcat-auth.rs
+++ b/rust/src/bin/fatcat-auth.rs
@@ -106,7 +106,11 @@ fn run() -> Result<()> {
},
("create-token", Some(subm)) => {
let editor_id = FatCatId::from_str(subm.value_of("editor-id").unwrap())?;
- println!("{}", confectionary.create_token(&db_conn, editor_id, None)?);
+ // check that editor exists
+ let _ed: fatcat::database_models::EditorRow = fatcat::database_schema::editor::table
+ .find(&editor_id.to_uuid())
+ .get_result(&db_conn)?;
+ println!("{}", confectionary.create_token(editor_id, None)?);
},
("inspect-token", Some(subm)) => {
confectionary.inspect_token(&db_conn, subm.value_of("token").unwrap())?;