summaryrefslogtreecommitdiffstats
path: root/src/models/auth.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-13 12:51:32 +0000
committerSanto Cariotti <santo@dcariotti.me>2022-09-13 12:51:32 +0000
commit64d5f37d9e28363f27b49b9a5b421a19792d0165 (patch)
tree210cbea0a4b17adee8c8916c3089a18fb9c77fbc /src/models/auth.rs
parentce62e3bac6a8acea555731d6222028c511dd9019 (diff)
Signup route
Diffstat (limited to 'src/models/auth.rs')
-rw-r--r--src/models/auth.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/models/auth.rs b/src/models/auth.rs
index 8a70244..651bf26 100644
--- a/src/models/auth.rs
+++ b/src/models/auth.rs
@@ -32,13 +32,22 @@ pub struct AuthBody {
token_type: String,
}
-/// Payload used for user creation
+/// Payload used for login
#[derive(Deserialize)]
pub struct LoginCredentials {
pub username: String,
pub password: String,
}
+/// Paylod used for user creation
+#[derive(Deserialize)]
+pub struct SignUpForm {
+ pub email: String,
+ pub username: String,
+ pub password1: String,
+ pub password2: String,
+}
+
static KEYS: Lazy<Keys> = Lazy::new(|| {
let secret = &crate::config::CONFIG.jwt_secret;
Keys::new(secret.as_bytes())