summaryrefslogtreecommitdiffstats
path: root/src/graphql/types
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-08-30 13:43:29 +0000
committerSanto Cariotti <santo@dcariotti.me>2024-08-30 13:43:29 +0000
commitc11d902f7e37e5bbd5565bf7353e459c793ade52 (patch)
tree9c93cf309c22923468d366749eb094f7899b80f3 /src/graphql/types
parent7c492396257462f96aba047febf3168f8ec2524e (diff)
Return user_id on JWT creation
Diffstat (limited to 'src/graphql/types')
-rw-r--r--src/graphql/types/jwt.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/graphql/types/jwt.rs b/src/graphql/types/jwt.rs
index 475b1bd..df815aa 100644
--- a/src/graphql/types/jwt.rs
+++ b/src/graphql/types/jwt.rs
@@ -77,13 +77,16 @@ pub struct AuthBody {
access_token: String,
/// "Bearer" string
token_type: String,
+ /// User id
+ user_id: i32,
}
impl AuthBody {
- pub fn new(access_token: String) -> Self {
+ pub fn new(access_token: String, user_id: i32) -> Self {
Self {
access_token,
token_type: "Bearer".to_string(),
+ user_id,
}
}
}