From bdba837a0c62d91bb2c34874f08c7b29e1189e5c Mon Sep 17 00:00:00 2001 From: Jens Reimann Date: Thu, 18 Apr 2024 13:31:22 +0200 Subject: [PATCH] chore: update dependencies --- Cargo.toml | 8 +++--- README.md | 36 +++++++++++++------------- yew-oauth2-example/Cargo.toml | 6 ++--- yew-oauth2-example/src/app.rs | 12 ++++----- yew-oauth2-redirect-example/Cargo.toml | 5 ++-- yew-oauth2-redirect-example/src/app.rs | 10 +++---- 6 files changed, 38 insertions(+), 39 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0ec60cf..6c1d9fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yew-oauth2" -version = "0.10.2" +version = "0.11.0-alpha.1" authors = ["Jens Reimann "] edition = "2021" license = "Apache-2.0" @@ -20,7 +20,7 @@ js-sys = "0.3" log = "0.4" num-traits = "0.2" oauth2 = "4" -reqwest = "0.11" +reqwest = "0.12" serde = { version = "1", features = ["derive"] } time = { version = "0.3", features = ["wasm-bindgen"] } tokio = { version = "1", features = ["sync"] } @@ -33,11 +33,9 @@ web-sys = { version = "0.3", features = [ ] } openidconnect = { version = "3.0", optional = true } -yew-nested-router = { version = "0.6.3", optional = true } +yew-nested-router = { version = "0.7.0-alpha.1", optional = true } [features] -# Enable for Yew nested router support -nested-router = ["yew-nested-router"] # Enable for OpenID Connect support openid = ["openidconnect"] diff --git a/README.md b/README.md index 7d32a7a..4c0fdf1 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ Add to your `Cargo.toml`: yew-oauth2 = "0.10" ``` -By default, the `nested-router` integration for [`yew-nested-router`](https://github.com/ctron/yew-nested-router) is disabled, -you can enable it using: +By default, the `yew-nested-router` integration for [`yew-nested-router`](https://github.com/ctron/yew-nested-router) is +disabled. You can enable it using: ```toml -yew-oauth2 = { version = "0.10", features = ["nested-router"] } +yew-oauth2 = { version = "0.10", features = ["yew-nested-router"] } ``` ## OpenID Connect @@ -23,7 +23,7 @@ OpenID Connect requires an additional dependency and can be enabled using the fe ## Examples -A quick example how to use it (see below for more complete examples): +A quick example of how to use it (see below for more complete examples): ```rust use yew::prelude::*; @@ -32,13 +32,13 @@ use yew_oauth2::oauth2::*; // use `openid::*` when using OpenID connect #[function_component(MyApplication)] fn my_app() -> Html { - let config = Config::new( - "my-client", - "https://my-sso/auth/realms/my-realm/protocol/openid-connect/auth", - "https://my-sso/auth/realms/my-realm/protocol/openid-connect/token" - ); + let config = Config::new( + "my-client", + "https://my-sso/auth/realms/my-realm/protocol/openid-connect/auth", + "https://my-sso/auth/realms/my-realm/protocol/openid-connect/token" + ); - html!( + html!( @@ -47,16 +47,16 @@ fn my_app() -> Html { #[function_component(MyApplicationMain)] fn my_app_main() -> Html { - let agent = use_auth_agent().expect("Must be nested inside an OAuth2 component"); + let agent = use_auth_agent().expect("Must be nested inside an OAuth2 component"); - let login = use_callback(agent.clone(), |_, agent| { - let _ = agent.start_login(); - }); - let logout = use_callback(agent, |_, agent| { - let _ = agent.logout(); - }); + let login = use_callback(agent.clone(), |_, agent| { + let _ = agent.start_login(); + }); + let logout = use_callback(agent, |_, agent| { + let _ = agent.logout(); + }); - html!( + html!( <> diff --git a/yew-oauth2-example/Cargo.toml b/yew-oauth2-example/Cargo.toml index 95d42a0..a07473d 100644 --- a/yew-oauth2-example/Cargo.toml +++ b/yew-oauth2-example/Cargo.toml @@ -11,10 +11,10 @@ humantime = "2" log = { version = "0.4", features = [] } serde_json = "1" time = "0.3" -wasm-bindgen = "0.2.79" +wasm-bindgen = "0.2.92" wasm-logger = "0.2" -yew = { version = "0.21", features = ["csr"] } -yew-nested-router = "0.6.1" +yew = { version = "0.21.0", features = ["csr"] } +yew-nested-router = "0.7.0-alpha.1" openidconnect = { version = "3.0", optional = true } diff --git a/yew-oauth2-example/src/app.rs b/yew-oauth2-example/src/app.rs index 6bb771e..b79af87 100644 --- a/yew-oauth2-example/src/app.rs +++ b/yew-oauth2-example/src/app.rs @@ -40,7 +40,7 @@ pub fn content() -> Html { #[cfg(feature = "openid")] let openid_routes = html! ( -
  • target={AppRoute::Identity}> { "Identity" } >
  • +
  • to={AppRoute::Identity}> { "Identity" } >
  • ); #[cfg(not(feature = "openid"))] let openid_routes = html!(); @@ -58,11 +58,11 @@ pub fn content() -> Html {

      -
    • target={AppRoute::Index}> { "Index" } >
    • -
    • target={AppRoute::Component}> { "Component" } >
    • -
    • target={AppRoute::Function}> { "Function" } >
    • -
    • target={AppRoute::UseAuthentication}> { "Use" } >
    • -
    • target={AppRoute::UseLatestToken}> { "Latest Token" } >
    • +
    • to={AppRoute::Index}> { "Index" } >
    • +
    • to={AppRoute::Component}> { "Component" } >
    • +
    • to={AppRoute::Function}> { "Function" } >
    • +
    • to={AppRoute::UseAuthentication}> { "Use" } >
    • +
    • to={AppRoute::UseLatestToken}> { "Latest Token" } >
    • { openid_routes }
    diff --git a/yew-oauth2-redirect-example/Cargo.toml b/yew-oauth2-redirect-example/Cargo.toml index efa3e60..7e83963 100644 --- a/yew-oauth2-redirect-example/Cargo.toml +++ b/yew-oauth2-redirect-example/Cargo.toml @@ -5,15 +5,16 @@ edition = "2021" [dependencies] yew-oauth2 = { path = "..", features = ["yew-nested-router"] } + gloo-timers = "0.3" humantime = "2" log = { version = "0.4", features = [] } serde_json = "1" time = "0.3" -wasm-bindgen = "0.2.79" +wasm-bindgen = "0.2.92" wasm-logger = "0.2" yew = { version = "0.21.0", features = ["csr"] } -yew-nested-router = "0.6.1" +yew-nested-router = "0.7.0-alpha.1" openidconnect = { version = "3.0", optional = true } diff --git a/yew-oauth2-redirect-example/src/app.rs b/yew-oauth2-redirect-example/src/app.rs index 61e5e2b..1d7d161 100644 --- a/yew-oauth2-redirect-example/src/app.rs +++ b/yew-oauth2-redirect-example/src/app.rs @@ -49,12 +49,12 @@ pub fn content() -> Html { /* We show the full menu structure here */
      -
    • target={AppRoute::Index}> { "Public" } >
    • -
    • target={AppRoute::Authenticated(AuthenticatedRoute::Index)}> { "Authenticated" } > +
    • to={AppRoute::Index}> { "Public" } >
    • +
    • to={AppRoute::Authenticated(AuthenticatedRoute::Index)}> { "Authenticated" } >
        -
      • target={AppRoute::Authenticated(AuthenticatedRoute::Component)}> { "Component" } >
      • -
      • target={AppRoute::Authenticated(AuthenticatedRoute::Function)}> { "Function" } >
      • -
      • target={AppRoute::Authenticated(AuthenticatedRoute::UseAuthentication)}> { "Use" } >
      • +
      • to={AppRoute::Authenticated(AuthenticatedRoute::Component)}> { "Component" } >
      • +
      • to={AppRoute::Authenticated(AuthenticatedRoute::Function)}> { "Function" } >
      • +
      • to={AppRoute::Authenticated(AuthenticatedRoute::UseAuthentication)}> { "Use" } >