mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-02-22 00:42:03 +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:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -39,3 +39,6 @@ __debug_*
|
||||
|
||||
# infisical
|
||||
/.infisical.json
|
||||
|
||||
# traefik data
|
||||
/traefik
|
||||
|
||||
@@ -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