| 50 | }; |
| 51 | |
| 52 | const handleRedirectAuth = (params: URLSearchParams): boolean => { |
| 53 | const href = window.sessionStorage.getItem(AUTH_REDIRECT_KEY); |
| 54 | |
| 55 | if (!href) { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | const [redirect, hrefParams] = href.split('?'); |
| 60 | const redirectParams = new URLSearchParams(hrefParams); |
| 61 | |
| 62 | Object.entries(redirectParams).forEach(([key, value]) => |
| 63 | params.set(key, value), |
| 64 | ); |
| 65 | |
| 66 | window.location.replace(`${redirect}?${params}`); |
| 67 | return true; |
| 68 | }; |
| 69 | |
| 70 | const getAuthReturnPath = (): string => { |
| 71 | const path = window.sessionStorage.getItem(AUTH_RETURN_PATH_KEY); |