mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-02-26 02:41:59 +00:00
fix: use the href of the url object instead of the object iself as the
dep in the callback
This commit is contained in:
@@ -32,6 +32,8 @@ export const ContinuePage = () => {
|
||||
cookieDomain,
|
||||
);
|
||||
|
||||
const urlHref = url?.href;
|
||||
|
||||
const hasValidRedirect = valid && allowedProto;
|
||||
const showUntrustedWarning =
|
||||
hasValidRedirect && !trusted && !disableUiWarnings;
|
||||
@@ -44,13 +46,13 @@ export const ContinuePage = () => {
|
||||
!showInsecureWarning;
|
||||
|
||||
const redirectToTarget = useCallback(() => {
|
||||
if (!url || hasRedirected.current) {
|
||||
if (!urlHref || hasRedirected.current) {
|
||||
return;
|
||||
}
|
||||
|
||||
hasRedirected.current = true;
|
||||
window.location.assign(url);
|
||||
}, [url]);
|
||||
window.location.assign(urlHref);
|
||||
}, [urlHref]);
|
||||
|
||||
const handleRedirect = useCallback(() => {
|
||||
setIsLoading(true);
|
||||
|
||||
Reference in New Issue
Block a user