Updated chat service to use session id instead of client id
This commit is contained in:
@@ -39,14 +39,14 @@ impl MyChatService {
|
||||
}
|
||||
|
||||
fn get_authenticated_id(metadata: &MetadataMap) -> Result<String, Status> {
|
||||
if let Some(client_id_val) = metadata.get("x-client-id") {
|
||||
if let Some(session_id_val) = metadata.get("x-session-id") {
|
||||
// Convert the header to a string.
|
||||
client_id_val
|
||||
session_id_val
|
||||
.to_str()
|
||||
.map(ToString::to_string)
|
||||
.map_err(|_| Status::unauthenticated("Invalid client ID header"))
|
||||
.map_err(|_| Status::unauthenticated("Invalid session ID header"))
|
||||
} else {
|
||||
Err(Status::unauthenticated("Missing client ID header"))
|
||||
Err(Status::unauthenticated("Missing session ID header"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user