mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix: moved handler to form submission
This commit is contained in:
@@ -32,7 +32,8 @@ export const PasswordStep = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const handleLogin = async () => {
|
const handleLogin = async (e:React.FormEvent) => {
|
||||||
|
e.preventDefault()
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
@@ -102,10 +103,12 @@ export const PasswordStep = ({
|
|||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form
|
<form
|
||||||
onSubmit={(e) => e.preventDefault()}
|
onSubmit={handleLogin}
|
||||||
className="h-full mx-auto w-full max-w-md px-6 pt-8"
|
className="h-full mx-auto w-full max-w-md px-6 pt-8"
|
||||||
>
|
>
|
||||||
<p className="mx-auto mb-6 flex w-max justify-center text-xl font-medium text-transparent bg-clip-text bg-gradient-to-b from-white to-bunker-200 text-center mb-8">
|
<p className="mx-auto mb-6 flex w-max justify-center text-xl font-medium text-transparent bg-clip-text bg-gradient-to-b from-white to-bunker-200 text-center mb-8">
|
||||||
@@ -130,7 +133,6 @@ export const PasswordStep = ({
|
|||||||
type="submit"
|
type="submit"
|
||||||
colorSchema="primary"
|
colorSchema="primary"
|
||||||
variant="outline_bg"
|
variant="outline_bg"
|
||||||
onClick={async () => handleLogin()}
|
|
||||||
isFullWidth
|
isFullWidth
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
className="h-14"
|
className="h-14"
|
||||||
|
|||||||
@@ -15,12 +15,19 @@ export const SAMLSSOStep = ({
|
|||||||
|
|
||||||
const queryParams = new URLSearchParams(window.location.search);
|
const queryParams = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
|
const handleSubmission = (e:React.FormEvent) => {
|
||||||
|
e.preventDefault()
|
||||||
|
const callbackPort = queryParams.get("callback_port");
|
||||||
|
window.open(`/api/v1/sso/redirect/saml2/${ssoIdentifier}${callbackPort ? `?callback_port=${callbackPort}` : ""}`);
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto w-full max-w-md md:px-6">
|
<div className="mx-auto w-full max-w-md md:px-6">
|
||||||
<p className="mx-auto mb-6 flex w-max justify-center text-xl font-medium text-transparent bg-clip-text bg-gradient-to-b from-white to-bunker-200 text-center mb-8">
|
<p className="mx-auto mb-6 flex w-max justify-center text-xl font-medium text-transparent bg-clip-text bg-gradient-to-b from-white to-bunker-200 text-center mb-8">
|
||||||
What's your SSO Identifier?
|
What's your SSO Identifier?
|
||||||
</p>
|
</p>
|
||||||
<form>
|
<form onSubmit={handleSubmission}>
|
||||||
<div className="relative flex items-center justify-center lg:w-1/6 w-1/4 min-w-[20rem] md:min-w-[22rem] mx-auto w-full rounded-lg max-h-24 md:max-h-28">
|
<div className="relative flex items-center justify-center lg:w-1/6 w-1/4 min-w-[20rem] md:min-w-[22rem] mx-auto w-full rounded-lg max-h-24 md:max-h-28">
|
||||||
<div className="flex items-center justify-center w-full rounded-lg max-h-24 md:max-h-28">
|
<div className="flex items-center justify-center w-full rounded-lg max-h-24 md:max-h-28">
|
||||||
<Input
|
<Input
|
||||||
@@ -40,11 +47,6 @@ export const SAMLSSOStep = ({
|
|||||||
type="submit"
|
type="submit"
|
||||||
colorSchema="primary"
|
colorSchema="primary"
|
||||||
variant="outline_bg"
|
variant="outline_bg"
|
||||||
onClick={() => {
|
|
||||||
const callbackPort = queryParams.get("callback_port");
|
|
||||||
window.open(`/api/v1/sso/redirect/saml2/${ssoIdentifier}${callbackPort ? `?callback_port=${callbackPort}` : ""}`);
|
|
||||||
window.close();
|
|
||||||
}}
|
|
||||||
isFullWidth
|
isFullWidth
|
||||||
className="h-14"
|
className="h-14"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user