mirror of https://github.com/apibillme/broker
turn auth back on for sse
This commit is contained in:
parent
124f259e2c
commit
cd311c6594
|
@ -515,8 +515,8 @@ pub async fn broker() {
|
|||
});
|
||||
|
||||
let sse_route = warp::path("events")
|
||||
// .and(auth_check)
|
||||
.and(warp::get()).map(move || {
|
||||
.and(auth_check)
|
||||
.and(warp::get()).map(move |jwt: JWT| {
|
||||
let tree = TREE.get(&"tree".to_owned()).unwrap();
|
||||
let mut vals : Vec<Event> = tree.iter().into_iter().filter(|x| {
|
||||
let p = x.as_ref().unwrap();
|
||||
|
@ -560,7 +560,7 @@ pub async fn broker() {
|
|||
}
|
||||
|
||||
let event_stream = interval(Duration::from_millis(100)).map(move |_| {
|
||||
event_stream(true)
|
||||
event_stream(jwt.check)
|
||||
});
|
||||
|
||||
warp::sse::reply(event_stream)
|
||||
|
|
Loading…
Reference in New Issue