- update: schema now sets the skills column to prevent a crash

- update: frontend to only pass the session id
- update: launcher to pass the session correctly
- update: validate session response now returns the session id and user id to the requester
- update: auth client based on session id instead of a jwt token
This commit is contained in:
2025-03-08 13:47:53 -05:00
parent b6f2d3f456
commit 8ba8fce20b
13 changed files with 151 additions and 79 deletions

View File

@@ -36,7 +36,7 @@ impl AuthService for MyAuthService {
&req.username,
&req.password,
)
.await
.await
{
let user_id = user.user_id.to_string();
let session_id = uuid::Uuid::new_v4().to_string();
@@ -146,12 +146,13 @@ impl AuthService for MyAuthService {
match response {
Ok(res) => {
debug!("Session valid: {:?}", res.into_inner());
Ok(Response::new(ValidateSessionResponse { valid: true }))
let res = res.into_inner();
debug!("Session valid: {:?}", res);
Ok(Response::new(ValidateSessionResponse { valid: true, session_id: res.session_id.to_string(), user_id: res.user_id.to_string() }))
}
Err(_) => {
debug!("Session invalid or not found");
Ok(Response::new(ValidateSessionResponse { valid: false }))
Ok(Response::new(ValidateSessionResponse { valid: false, session_id: "".to_string(), user_id: "".to_string() }))
}
}
}
@@ -172,12 +173,13 @@ impl AuthService for MyAuthService {
match response {
Ok(res) => {
debug!("Session valid: {:?}", res.into_inner());
Ok(Response::new(ValidateSessionResponse { valid: true }))
let res = res.into_inner();
debug!("Session valid: {:?}", res);
Ok(Response::new(ValidateSessionResponse { valid: true, session_id: res.session_id.to_string(), user_id: res.user_id.to_string() }))
}
Err(_) => {
debug!("Session invalid or not found");
Ok(Response::new(ValidateSessionResponse { valid: false }))
Ok(Response::new(ValidateSessionResponse { valid: false, session_id: "".to_string(), user_id: "".to_string() }))
}
}
}