use super::missing_context;
use crate::context::OAuth2Context;
use yew::prelude::*;
#[derive(Clone, Debug, PartialEq, Properties)]
pub struct AuthenticatedProperties {
pub children: Children,
}
#[component(Authenticated)]
pub fn authenticated(props: &AuthenticatedProperties) -> Html {
let auth = use_context::<OAuth2Context>();
html!(
if let Some(auth) = auth {
if let OAuth2Context::Authenticated{..} = auth {
{ for props.children.iter() }
}
} else {
{ missing_context() }
}
)
}