MCPcopy Create free account
hub / github.com/dailydotdev/apps / handleRedirectAuth

Function handleRedirectAuth

packages/webapp/pages/callback.tsx:52–68  ·  view source on GitHub ↗
(params: URLSearchParams)

Source from the content-addressed store, hash-verified

50};
51
52const 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
70const getAuthReturnPath = (): string => {
71 const path = window.sessionStorage.getItem(AUTH_RETURN_PATH_KEY);

Callers 1

CallbackPageFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected