clean code; if logged out: save url where user tried to go to, go there once logged in, Fixes #179
This commit is contained in:
@@ -89,7 +89,15 @@ async fn login(
|
||||
)
|
||||
.await;
|
||||
|
||||
Flash::success(Redirect::to("/"), "Login erfolgreich")
|
||||
// Check for redirect_url cookie and redirect accordingly
|
||||
match cookies.get_private("redirect_url") {
|
||||
Some(redirect_cookie) => {
|
||||
let redirect_url = redirect_cookie.value().to_string();
|
||||
cookies.remove_private(redirect_cookie); // Remove the cookie after using it
|
||||
Flash::success(Redirect::to(redirect_url), "Login erfolgreich")
|
||||
}
|
||||
None => Flash::success(Redirect::to("/"), "Login erfolgreich"),
|
||||
}
|
||||
}
|
||||
|
||||
#[get("/set-pw/<userid>")]
|
||||
|
Reference in New Issue
Block a user