Merge branch 'main' of github.com:CoryHawkless/gatehouse-ui
This commit is contained in:
@@ -11,7 +11,7 @@ export default function InviteAcceptPage() {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
const token = searchParams.get("token") || "";
|
const token = searchParams.get("token") || "";
|
||||||
const { login } = useAuth();
|
const { refreshUser, checkOrgAdmin } = useAuth();
|
||||||
|
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
@@ -63,6 +63,8 @@ export default function InviteAcceptPage() {
|
|||||||
// Store the token manually since we're not using the normal login flow
|
// Store the token manually since we're not using the normal login flow
|
||||||
localStorage.setItem("secuird_token", result.token);
|
localStorage.setItem("secuird_token", result.token);
|
||||||
}
|
}
|
||||||
|
await refreshUser();
|
||||||
|
await checkOrgAdmin();
|
||||||
navigate("/profile");
|
navigate("/profile");
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
const msg = err instanceof ApiError ? err.message : "Failed to accept invite.";
|
const msg = err instanceof ApiError ? err.message : "Failed to accept invite.";
|
||||||
|
|||||||
Reference in New Issue
Block a user