mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-25 07:27:39 +00:00
push instead of redirect
This commit is contained in:
@@ -65,10 +65,14 @@ export function SessionItem({
|
||||
<button
|
||||
onClick={async () => {
|
||||
if (valid && session?.factors?.user) {
|
||||
return continueWithSession({
|
||||
const resp = await continueWithSession({
|
||||
...session,
|
||||
authRequestId: authRequestId,
|
||||
});
|
||||
|
||||
if (resp?.redirect) {
|
||||
return router.push(resp.redirect);
|
||||
}
|
||||
} else if (session.factors?.user) {
|
||||
setLoading(true);
|
||||
const res = await sendLoginname({
|
||||
|
@@ -15,7 +15,6 @@ import { RequestChallenges } from "@zitadel/proto/zitadel/session/v2/challenge_p
|
||||
import { Session } from "@zitadel/proto/zitadel/session/v2/session_pb";
|
||||
import { Checks } from "@zitadel/proto/zitadel/session/v2/session_service_pb";
|
||||
import { headers } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import { getNextUrl } from "../client";
|
||||
import {
|
||||
getMostRecentSessionCookie,
|
||||
@@ -108,7 +107,7 @@ export async function continueWithSession({
|
||||
)
|
||||
: null;
|
||||
if (url) {
|
||||
return redirect(url);
|
||||
return { redirect: url };
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user