mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 10:15:56 +08:00
1627 login: onsubmit is added (#1635)
* feat: onsubmit is updated * chore: precheckComplete handler is updated
This commit is contained in:
parent
acd15af823
commit
f580bedb1c
@ -111,6 +111,8 @@ function Login({
|
|||||||
setFunc(value);
|
setFunc(value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const { sso, canSelfRegister } = precheckResult;
|
||||||
|
|
||||||
const onSubmitHandler: React.FormEventHandler<HTMLFormElement> = async (
|
const onSubmitHandler: React.FormEventHandler<HTMLFormElement> = async (
|
||||||
event,
|
event,
|
||||||
) => {
|
) => {
|
||||||
@ -123,6 +125,11 @@ function Login({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (precheckComplete && sso) {
|
||||||
|
window.location.href = precheckResult.ssoUrl || '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
const response = await loginApi({
|
const response = await loginApi({
|
||||||
@ -176,8 +183,6 @@ function Login({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { sso, canSelfRegister } = precheckResult;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormWrapper>
|
<FormWrapper>
|
||||||
<FormContainer onSubmit={onSubmitHandler}>
|
<FormContainer onSubmit={onSubmitHandler}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user