MCPcopy
hub / github.com/chartbrew/chartbrew / redirectUser

Function redirectUser

client/src/containers/UserInvite.jsx:26–40  ·  view source on GitHub ↗
(route)

Source from the content-addressed store, hash-verified

24 }, [user]);
25
26 const redirectUser = async (route) => {
27 const params = new URLSearchParams(window.location.search);
28 const token = params.get("token");
29
30 removeAuthToken();
31 await dispatch(clearUser(true));
32
33 setTimeout(() => {
34 if (route === "login") {
35 navigate(`/login?inviteToken=${token}`);
36 } else {
37 navigate(`/signup?inviteToken=${token}`);
38 }
39 }, 100);
40 };
41
42 return (
43 <div className="min-h-screen bg-surface-secondary px-6 py-6 sm:px-8 sm:py-8">

Callers 1

UserInviteFunction · 0.85

Calls 3

removeAuthTokenFunction · 0.90
dispatchFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected