Resolve the exhaustive-deps findings and attach cause to the rethrown errors. [skip build]
This commit is contained in:
1 parent
027dbee1f1
commit
634d1e0a0f
12 files changed
+31
-49
No files matched your search
@@ -16,11 +16,6 @@ export function SSOLogin({ providers, redirectUrl, action, saveScreenSpace }: SS
|
||||
const mx = useMemo(() => createClient({ baseUrl }), [baseUrl]);
|
||||
const [launchingProviderId, setLaunchingProviderId] = useState<string | null>(null);
|
||||
|
||||
const getSSOIdUrl = (ssoId?: string): string => {
|
||||
const existingDeviceId = localStorage.getItem('cinny_device_id') ?? undefined;
|
||||
return mx.getSsoLoginUrl(redirectUrl, 'sso', ssoId, action, existingDeviceId);
|
||||
};
|
||||
|
||||
const handleContinue = useCallback(
|
||||
async (providerId?: string) => {
|
||||
if (launchingProviderId) {
|
||||
@@ -39,12 +34,15 @@ export function SSOLogin({ providers, redirectUrl, action, saveScreenSpace }: SS
|
||||
}
|
||||
|
||||
try {
|
||||
await openExternalUrl(getSSOIdUrl(providerId));
|
||||
const existingDeviceId = localStorage.getItem('cinny_device_id') ?? undefined;
|
||||
await openExternalUrl(
|
||||
mx.getSsoLoginUrl(redirectUrl, 'sso', providerId, action, existingDeviceId),
|
||||
);
|
||||
} finally {
|
||||
setLaunchingProviderId(null);
|
||||
}
|
||||
},
|
||||
[getSSOIdUrl, launchingProviderId],
|
||||
[mx, redirectUrl, action, launchingProviderId],
|
||||
);
|
||||
|
||||
const withoutIcon = providers
|
||||
|
||||
Reference in new issue
Block a user