turn auth back on for sse

This commit is contained in:
Bevan Hunt 2020-01-28 14:39:16 -08:00
parent 124f259e2c
commit cd311c6594
1 changed files with 3 additions and 3 deletions

View File

@ -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)