Skip to content

Commit

Permalink
fix login next url
Browse files Browse the repository at this point in the history
  • Loading branch information
lyang2821 committed Oct 12, 2024
1 parent 4c5d7cf commit 92451e1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lapdev-dashboard/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ pub async fn get_login() -> Result<MeUser> {

async fn now_login(provider: AuthProvider) -> Result<()> {
let location = use_location();
let next = format!(
"{}{}",
location.pathname.get_untracked(),
location.search.get_untracked()
);
let next = format!("{}{}", location.pathname.get_untracked(), {
let search = location.search.get_untracked();
if search.is_empty() {
"".to_string()
} else {
format!("?{search}")
}
});
let next = urlencoding::encode(&next).to_string();
let location = window().window().location();
let resp = Request::get("/api/private/session")
.query([
Expand Down

0 comments on commit 92451e1

Please sign in to comment.