From 2c6434e0b89e93ab6bdddb28bcd059b48638cb0d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 3 Sep 2022 12:10:20 +0200 Subject: Users has username and use it for login --- src/models/auth.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/models/auth.rs') diff --git a/src/models/auth.rs b/src/models/auth.rs index 8b8f61c..7f9ae00 100644 --- a/src/models/auth.rs +++ b/src/models/auth.rs @@ -32,6 +32,13 @@ pub struct AuthBody { token_type: String, } +/// Payload used for user creation +#[derive(Deserialize)] +pub struct LoginCredentials { + pub username: String, + pub password: String, +} + static KEYS: Lazy = Lazy::new(|| { let secret = std::env::var("JWT_SECRET").expect("JWT_SECRET must be set"); Keys::new(secret.as_bytes()) -- cgit v1.2.3-71-g8e6c