diff options
| author | Santo Cariotti <santo@dcariotti.me> | 2022-09-03 10:10:20 +0000 |
|---|---|---|
| committer | Santo Cariotti <santo@dcariotti.me> | 2022-09-03 10:10:20 +0000 |
| commit | 2c6434e0b89e93ab6bdddb28bcd059b48638cb0d (patch) | |
| tree | 34844dc8d86780d25261c9082cf715226696c6ab /src/models/auth.rs | |
| parent | 6cda1b704d1c38fc116e59a2a206c2adebfb6d4d (diff) | |
Users has username and use it for login
Diffstat (limited to 'src/models/auth.rs')
| -rw-r--r-- | src/models/auth.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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<Keys> = Lazy::new(|| { let secret = std::env::var("JWT_SECRET").expect("JWT_SECRET must be set"); Keys::new(secret.as_bytes()) |
