mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-02-28 20:02:04 +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
|
||||||
/.infisical.json
|
/.infisical.json
|
||||||
|
|
||||||
|
# traefik data
|
||||||
|
/traefik
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ export const ContinuePage = () => {
|
|||||||
cookieDomain,
|
cookieDomain,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const urlHref = url?.href;
|
||||||
|
|
||||||
const hasValidRedirect = valid && allowedProto;
|
const hasValidRedirect = valid && allowedProto;
|
||||||
const showUntrustedWarning =
|
const showUntrustedWarning =
|
||||||
hasValidRedirect && !trusted && !disableUiWarnings;
|
hasValidRedirect && !trusted && !disableUiWarnings;
|
||||||
@@ -44,13 +46,13 @@ export const ContinuePage = () => {
|
|||||||
!showInsecureWarning;
|
!showInsecureWarning;
|
||||||
|
|
||||||
const redirectToTarget = useCallback(() => {
|
const redirectToTarget = useCallback(() => {
|
||||||
if (!url || hasRedirected.current) {
|
if (!urlHref || hasRedirected.current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hasRedirected.current = true;
|
hasRedirected.current = true;
|
||||||
window.location.assign(url);
|
window.location.assign(urlHref);
|
||||||
}, [url]);
|
}, [urlHref]);
|
||||||
|
|
||||||
const handleRedirect = useCallback(() => {
|
const handleRedirect = useCallback(() => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user