@@ -3,7 +3,7 @@ import { useTranslate } from "@probo/i18n";
|
||||
import { Button, Field, IconChevronLeft, useToast } from "@probo/ui";
|
||||
import type { FormEventHandler } from "react";
|
||||
import { useMutation } from "react-relay";
|
||||
import { Link, useLocation, useSearchParams } from "react-router";
|
||||
import { Link, useLocation, useNavigate, useSearchParams } from "react-router";
|
||||
import { graphql } from "relay-runtime";
|
||||
|
||||
import type { PasswordSignInPageMutation } from "#/__generated__/iam/PasswordSignInPageMutation.graphql";
|
||||
@@ -21,6 +21,7 @@ const signInMutation = graphql`
|
||||
export default function PasswordSignInPage() {
|
||||
const location = useLocation();
|
||||
const [searchParams] = useSearchParams();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { __ } = useTranslate();
|
||||
const { toast } = useToast();
|
||||
@@ -58,7 +59,7 @@ export default function PasswordSignInPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = searchParams.get("redirect-path") ?? "/";
|
||||
void navigate(searchParams.get("redirect-path") ?? "/");
|
||||
},
|
||||
onError: (e) => {
|
||||
toast({
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function SSOSignInPage() {
|
||||
<>
|
||||
<form className="space-y-6 w-full max-w-md mx-auto pt-4" onSubmit={handleSSOCheck}>
|
||||
<Link
|
||||
to={{ pathname: "/auth/register", search: location.search }}
|
||||
to={{ pathname: "/auth/login", search: location.search }}
|
||||
className="flex items-center gap-2 text-txt-secondary hover:text-txt-primary transition-colors mb-4"
|
||||
>
|
||||
<IconChevronLeft size={20} />
|
||||
|
||||
@@ -41,9 +41,9 @@ export function MembershipCard(props: MembershipCardProps) {
|
||||
fragment,
|
||||
fKey,
|
||||
);
|
||||
const isAssuming = !!lastSession;
|
||||
const isExpired
|
||||
= lastSession && parseDate(lastSession.expiresAt) < new Date();
|
||||
const isAssuming = !!lastSession && !isExpired;
|
||||
|
||||
const getAuthBadge = () => {
|
||||
if (isAssuming) {
|
||||
|
||||
@@ -70,7 +70,7 @@ function AssumePageInner() {
|
||||
search.set("organization-id", organizationId);
|
||||
search.set("redirect-path", redirectPath);
|
||||
|
||||
void navigate({ pathname: "/auth/passord-login", search: "?" + search.toString() });
|
||||
void navigate({ pathname: "/auth/password-login", search: "?" + search.toString() });
|
||||
break;
|
||||
case "SAMLAuthenticationRequired":
|
||||
samlSSOLoginURL = new URL(result.redirectUrl);
|
||||
|
||||
Reference in New Issue
Block a user