mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 07:25:51 +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);
|
||||
};
|
||||
|
||||
const { sso, canSelfRegister } = precheckResult;
|
||||
|
||||
const onSubmitHandler: React.FormEventHandler<HTMLFormElement> = async (
|
||||
event,
|
||||
) => {
|
||||
@ -123,6 +125,11 @@ function Login({
|
||||
return;
|
||||
}
|
||||
|
||||
if (precheckComplete && sso) {
|
||||
window.location.href = precheckResult.ssoUrl || '';
|
||||
return;
|
||||
}
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
const response = await loginApi({
|
||||
@ -176,8 +183,6 @@ function Login({
|
||||
);
|
||||
};
|
||||
|
||||
const { sso, canSelfRegister } = precheckResult;
|
||||
|
||||
return (
|
||||
<FormWrapper>
|
||||
<FormContainer onSubmit={onSubmitHandler}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user