mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 20:27:43 +00:00
Merge pull request #851 from sreehari2003/main
fix: form not submitting on keyboard enter
This commit is contained in:
@@ -40,7 +40,8 @@ export const PasswordStep = ({
|
|||||||
authMethod
|
authMethod
|
||||||
} = jwt_decode(providerAuthToken) as any;
|
} = jwt_decode(providerAuthToken) as any;
|
||||||
|
|
||||||
const handleLogin = async () => {
|
const handleLogin = async (e:React.FormEvent) => {
|
||||||
|
e.preventDefault()
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
@@ -119,10 +120,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"
|
||||||
>
|
>
|
||||||
<div className="mb-8">
|
<div className="mb-8">
|
||||||
@@ -153,9 +156,9 @@ export const PasswordStep = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className='lg:w-1/6 w-1/4 w-full mx-auto flex items-center justify-center min-w-[22rem] text-center rounded-md mt-4'>
|
<div className='lg:w-1/6 w-1/4 w-full mx-auto flex items-center justify-center min-w-[22rem] text-center rounded-md mt-4'>
|
||||||
<Button
|
<Button
|
||||||
|
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,11 +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 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
|
||||||
@@ -36,19 +44,16 @@ export const SAMLSSOStep = ({
|
|||||||
</div>
|
</div>
|
||||||
<div className='lg:w-1/6 w-1/4 w-full mx-auto flex items-center justify-center min-w-[20rem] md:min-w-[22rem] text-center rounded-md mt-4'>
|
<div className='lg:w-1/6 w-1/4 w-full mx-auto flex items-center justify-center min-w-[20rem] md:min-w-[22rem] text-center rounded-md mt-4'>
|
||||||
<Button
|
<Button
|
||||||
|
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"
|
||||||
>
|
>
|
||||||
{t("login.login")}
|
{t("login.login")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
<div className="flex flex-row items-center justify-center mt-4">
|
<div className="flex flex-row items-center justify-center mt-4">
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user