Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 28 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ leptos_router = { version = "0.8", features = [ "nightly" ] }
console_error_panic_hook = "0.1"
wasm-bindgen = "=0.2.100"

[patch.crates-io]
leptos = { git = 'https://github.com/johnbchron/leptos.git' }
leptos_axum = { git = 'https://github.com/johnbchron/leptos.git' }
leptos_meta = { git = 'https://github.com/johnbchron/leptos.git' }
leptos_router = { git = 'https://github.com/johnbchron/leptos.git' }

[profile.wasm-release]
codegen-units = 1
inherits = "release"
Expand Down
4 changes: 2 additions & 2 deletions crates/site-app/src/components/navbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use leptos::{either::Either, prelude::*};
use models::AuthUser;

use self::org_selector::OrgSelectorPopover;
use crate::{hooks::OrgHook, navigation::next_url_hook};
use crate::{hooks::OrgHook, navigation::next_url_encoded_hook};

#[component]
pub fn Navbar() -> impl IntoView {
Expand Down Expand Up @@ -46,7 +46,7 @@ fn NavbarUserArea() -> impl IntoView {

#[component]
fn LoggedOutUserAuthActions() -> impl IntoView {
let next_url = next_url_hook();
let next_url = next_url_encoded_hook();
let signup_url =
Signal::derive(move || format!("/auth/signup?next={}", next_url()));
let login_url =
Expand Down
10 changes: 7 additions & 3 deletions crates/site-app/src/hooks/login_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use leptos::{ev::Event, prelude::*};
use models::dvf::{EmailAddress, EmailAddressError};

use crate::{
navigation::{navigate_to, next_url_hook},
navigation::{navigate_to, next_url_string_hook},
reactive_utils::touched_input_bindings,
};

Expand All @@ -13,7 +13,7 @@ pub struct LoginHook {
email_signal: RwSignal<String>,
password_signal: RwSignal<String>,
submit_touched_signal: RwSignal<bool>,
next_url_memo: Memo<String>,
next_url_memo: Signal<String>,
action: Action<(), Result<bool, String>>,
}

Expand All @@ -22,7 +22,7 @@ impl LoginHook {
let email_signal = RwSignal::new(String::new());
let password_signal = RwSignal::new(String::new());
let submit_touched_signal = RwSignal::new(false);
let next_url_memo = next_url_hook();
let next_url_memo = next_url_string_hook();

let action = Action::new_local(move |(): &()| {
// json body for authenticate endpoint
Expand Down Expand Up @@ -140,6 +140,10 @@ impl LoginHook {
pub fn create_redirect_effect(&self) -> Effect<LocalStorage> {
let (action, next_url_memo) = (self.action, self.next_url_memo);
Effect::new(move || {
leptos::logging::log!(
"redirect effect set to navigate to {:?}",
next_url_memo()
);
if action.value().get() == Some(Ok(true)) {
navigate_to(&next_url_memo());
}
Expand Down
Loading