Redirect back to the originating page after sign-in, not always /
Deploy / deploy (push) Successful in 29s
Deploy / deploy (push) Successful in 29s
Sign in link now carries ?redirect=<question_id>; /auth/login stashes it in the session (validated same-site-path-only to avoid an open redirect via a crafted query param), /auth/callback reads it back for the final redirect instead of a hardcoded "/".
This commit is contained in:
+5
-1
@@ -138,7 +138,11 @@ fn QuestionView(
|
||||
.into_any()
|
||||
} else {
|
||||
view! {
|
||||
<a class="alt-submit" href="/auth/login" rel="external">
|
||||
<a
|
||||
class="alt-submit"
|
||||
href=format!("/auth/login?redirect={question_id}")
|
||||
rel="external"
|
||||
>
|
||||
"Sign in"
|
||||
</a>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user